Queries dead-letter messages by page for a specified Group ID and time range.
Operation description
Querying dead-letter messages by Group ID is a paged range query. This method applies only to scenarios in which you query messages without specifying a message ID.
- When you query dead-letter messages by Group ID, specify a time range that is as short as possible. A long time range can return too many messages and make it difficult to identify issues. The call flow is as follows:
For the first paged query, specify the Group ID, start time, end time, and the number of messages per page. If messages are found, the API returns the messages on the first page, the total number of pages, and a query task ID.
Use the returned query task ID to retrieve more pages of messages. In subsequent requests, specify the query task ID and the page number. The start time, end time, and number of messages per page in these requests are ignored because the values from the first query are used.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:QueryDLQMessage |
get |
Group
Group
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
string |
Yes |
The ID of the consumer group to query. |
GID_test_group_id |
| BeginTime |
integer |
Yes |
The start of the time range to query. This value is a UNIX timestamp in milliseconds.
If you specify |
1570723200000 |
| EndTime |
integer |
Yes |
The end of the time range to query. This value is a UNIX timestamp in milliseconds.
If you specify |
1570809600000 |
| TaskId |
string |
No |
The ID of the query task. Omit this parameter for the first query. For subsequent queries, use the task ID returned by the previous query. |
0BC1310300002A9F000021E4D7A48346 |
| CurrentPage |
integer |
Yes |
The page number to return. Pages start from 1. The value can be up to 50 and must not exceed the total number of pages. |
2 |
| PageSize |
integer |
No |
The number of messages to return on each page. Default value: 20. Minimum value: 5. Maximum value: 50.
If you specify |
5 |
| InstanceId |
string |
No |
The ID of the instance that contains the message. |
MQ_INST_111111111111_DOxxxxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. Each request has a unique ID. Use this ID to troubleshoot issues. |
B00CD3C8-D81E-4A41-85E2-38F19252**** |
| MsgFoundDo |
object |
The query result. |
|
| CurrentPage |
integer |
The current page number. |
1 |
| MsgFoundList |
object |
||
| OnsRestMessageDo |
array<object> |
The list of messages on the current page. The data type is the same as the data type of the response to the OnsDLQMessageGetById operation. |
|
|
array<object> |
|||
| StoreSize |
integer |
The message size in KB. |
406 |
| ReconsumeTimes |
integer |
The number of times the message has been reconsumed. |
1 |
| StoreTimestamp |
integer |
The UNIX timestamp for when the message was stored on the server. |
1570760999811 |
| InstanceId |
string |
The instance ID. |
MQ_INST_111111111111_DOxxxxxx |
| MsgId |
string |
The message ID. |
1E0578FE110F18B4AAC235C05F2***** |
| StoreHost |
string |
The server that stores the message. |
11.193.***.***:10911 |
| Topic |
string |
The topic of the message. |
test-mq_topic |
| PropertyList |
object |
||
| MessageProperty |
array<object> |
A list of message properties. |
|
|
object |
|||
| Value |
string |
The value of the message property. |
TagA |
| Name |
string |
The message property. Valid values:
For more information, see Terms. |
TAGS |
| BornTimestamp |
integer |
The UNIX timestamp for when the message was produced. |
1570760999721 |
| BodyCRC |
integer |
The cyclic redundancy check (CRC) value of the message body. |
914112295 |
| BornHost |
string |
The producer that generated the message. |
42.120.***.***:59270 |
| MaxPageCount |
integer |
The total number of pages available. |
400 |
| TaskId |
string |
The ID of the query task. This ID is returned on the first query. Use this ID to retrieve subsequent pages. |
0BC1310300002A9F000021E4D7A48346 |
Examples
Success response
JSON format
{
"RequestId": "B00CD3C8-D81E-4A41-85E2-38F19252****",
"MsgFoundDo": {
"CurrentPage": 1,
"MsgFoundList": {
"OnsRestMessageDo": [
{
"StoreSize": 406,
"ReconsumeTimes": 1,
"StoreTimestamp": 1570760999811,
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"MsgId": "1E0578FE110F18B4AAC235C05F2*****",
"StoreHost": "11.193.***.***:10911",
"Topic": "test-mq_topic",
"PropertyList": {
"MessageProperty": [
{
"Value": "TagA",
"Name": "TAGS"
}
]
},
"BornTimestamp": 1570760999721,
"BodyCRC": 914112295,
"BornHost": "42.120.***.***:59270"
}
]
},
"MaxPageCount": 400,
"TaskId": "0BC1310300002A9F000021E4D7A48346"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.