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:
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.
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. |
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.
BindingKey
filter.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.
Was this page helpful?