tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

Dead Letter Queue

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-12-02 19:46:29

Overview

A dead letter queue (DLQ) is a message queue under your account used to collect error event information and analyze causes of failures. If you have configured a DLQ for a function, an event will be sent to the DLQ if:
It still fails after the SCF platform retries it twice due to a user code execution error
It still fails after the SCF platform retries it for more than 24 hours due to an overrun error or system error
Message retention in the async queue reaches the upper limit.
Note:
The DLQ feature is currently in beta test. If you want to try it out, please submit a ticket to apply for the activation of CMQ.

DLQ Message Attributes

RequestId: (string) unique identifier of the event call request
ErrorCode: (numeric) error code status
ErrorMessage: (string) error message
When the DLQ delivers a message to CMQ, it encapsulates the attribute information and event information in a JSON request body in the following format:
{
"RequestId": "b615b896-d197-47d7-8919-xxx",
"ErrorCode": -1,
"ErrorMessage": "Traceback (most recent call last):\\n File \\"/var/user/index.py\\", line 5, in main_handler\\n if 'key1' in event.keys():\\nNameError: global name 'event' is not defined",
"Body": {
"AppId": xxx,
"Uin": "xxx",
"SubAccountUin": "xxx",
"RequestSource": "TRIGGER_TIMER",
"FunctionName": "tabortest",
"Namespace": "default",
"Qualifier": "$DEFAULT",
"InvocationType": "RequestResponse",
"ClientContext": "{\\"Type\\":\\"Timer\\",\\"TriggerName\\":\\"tabortimer\\",\\"Time\\":\\"2020-10-10T01:22:00Z\\",\\"Message\\":\\"\\"}",
"LogType": "",
"TimeStampForInvoker": "160229310xxx",
"RequestId": "b615b896-d197-47d7-8919-xxx",
"PushTime": "2020-10-10T09:22:00.061824591+08:00",
"RetryNum": 2,
"Ttl": 0
}
}
Structure
Content
AppId
APPID.
Uin
Root account ID.
SubAccountUin
Sub-account ID of the creator (this field may return null, indicating that no valid values can be obtained).
RequestSource
Trigger request source.
FunctionName
Function name.
Namespace
Namespace.
Qualifier
Version/Alias of the trigger function.
ClientContext
Parameters used to run the function, which are passed in JSON format. For the maximum parameter length, please see Limits.
TimeStampForInvoker
The millisecond timestamp when the function is invoked.
RequestId
Unique ID of request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.
PushTime
Time when the message is pushed to CMQ.
RetryNum
Number of retries (0–2).
Ttl
Retention time of the async queue event.

Directions

Creating DLQ

Note:
SCF currently supports a CMQ topic or queue as the DLQ for your choice. The DLQ of a function alias will follow the DLQ of the primary version, i.e., the first DLQ selected and configured when the alias is created in the console.
1. Log in to the CMQ console and create a DLQ. CMQ topics support filtering by tag or route match. To ensure that your subscribers can receive all error messages, when adding a subscriber, please leave the tag filter empty and enter "#" for the BindingKey filter.
2. Log in to the Serverless console and create a function.
3. Configure the DLQ. You can configure the DLQ on the Create Function or Configure Function page.

Monitoring DLQ

When using a DLQ, permission errors, incorrect resource configurations, or message sizes exceeding the size limit of the target queue or topic will cause DLQ delivery failures. You can query the "number of failed deliveries to DLQ" in the function monitoring information.
1. Log in to the Serverless console and select Function Service on the left sidebar.
2. Select the region of the function for which to monitor the DLQ at the top of the page and click the target function in the list to enter the function details page.
3. On the function details page, click Monitoring information to view the number of failed deliveries to the DLQ.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백