You can call this operation to query all dead-letter messages for a specified group ID within a specified time range by page.
It is a range search to query dead-letter messages by group ID. Query results are displayed to the caller by page. This operation is only applicable to scenarios where no message ID is available. We recommend that you shorten the query time range. Otherwise, it will be difficult to locate problems due to the excessive matched messages.
The procedure for calling this operation is as follows:
1. Specify the group ID, start time, end time, and number of entries on each page to return. If messages are available, the messages on the first page, total number of pages, and query task ID are returned by default.
2. Obtain messages by specifying the returned query task ID and the current page number.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | OnsDLQMessagePageQueryByGroupId |
The operation that you want to perform. Set the value to OnsDLQMessagePageQueryByGroupId. |
BeginTime | Long | Yes | 1570723200000 |
The beginning of the time range to query. |
CurrentPage | Integer | Yes | 2 |
The number of the page to return. Pages start from page 1. Valid values: 1 to 50. |
EndTime | Long | Yes | 1570809600000 |
The end of the time range to query. |
GroupId | String | Yes | GID_test_group_id |
The consumer group ID that you want to query. |
InstanceId | String | Yes | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance corresponding to the messages that you want to query. |
TaskId | String | No | 0BC1310300002A9F000021E4D7A48346 |
The ID of the query task. It is not required for the first query but is required when you obtain messages subsequently. It can be obtained based on the previously returned result. |
PageSize | Integer | No | 5 |
The number of entries to return on each page. Valid values: 5 to 50. Default value: 20. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
MsgFoundDo | Struct |
The returned query results. |
|
CurrentPage | Long | 1 |
The page number of the returned page. |
MaxPageCount | Long | 400 |
The maximum number of returned pages. |
MsgFoundList | Array |
A returned set of messages displayed on the current page. The parameters in MsgFoundList are the same as those returned for the OnsDLQMessageGetById operation. |
|
OnsRestMessageDo | |||
Body | String | SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv |
The body of the message. |
BodyCRC | Integer | 914112295 |
The cyclic redundancy check (CRC) value of the message body. |
BornHost | String | 42.120.***. ***:59270 |
The producer instance that produced the message. |
BornTimestamp | Long | 1570760999721 |
The timestamp indicating when the message was produced. |
InstanceId | String | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance corresponding to the message. |
MsgId | String | 1E0578FE110F18B4AAC235C05F2***** |
The ID of the message. |
PropertyList | Array |
A returned list of properties of the message. |
|
MessageProperty | |||
Name | String | TAGS |
The property of the message. Valid values:
For more information about the terms, see Terms. |
Value | String | TagA |
The value of the message property. |
ReconsumeTimes | Integer | 1 |
The number of consumption retries of the message. |
StoreHost | String | 11.193.***. ***:10911 |
The Message Queue for Apache RocketMQ broker that stored the message. |
StoreSize | Integer | 406 |
The size of the message. |
StoreTimestamp | Long | 1570760999811 |
The timestamp indicating when the Message Queue for Apache RocketMQ broker stored the message. |
Topic | String | test-mq_topic |
The topic of the message. |
TaskId | String | 0BC1310300002A9F000021E4D7A48346 |
The task ID returned for the first query task, which is used to obtain messages subsequently. |
RequestId | String | B00CD3C8-D81E-4A41-85E2-38F19252F1FF |
The ID of the request. This is a common parameter. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=OnsDLQMessagePageQueryByGroupId
&BeginTime=1570723200000
&CurrentPage=2
&EndTime=1570809600000
&GroupId=GID_test_group_id
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&TaskId=0BC1310300002A9F000021E4D7A48346
&PageSize=5
&<Common request parameters>
Sample success responses
XML
format
<OnsDLQMessagePageQueryByGroupIdResponse>
<MsgFoundDo>
<MaxPageCount>400</MaxPageCount>
<MsgFoundList>
<OnsRestMessageDo>
<MsgId>1E0578FE110F18B4AAC235C05F2*****</MsgId>
<Body>SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv</Body>
<InstanceId>MQ_INST_111111111111_DOxxxxxx</InstanceId>
<ReconsumeTimes>1</ReconsumeTimes>
<BornHost>42.120. ***. ***:59270</BornHost>
<StoreTimestamp>1570760999811</StoreTimestamp>
<StoreHost>11.193. ***. ***:10911</StoreHost>
<BodyCRC>914112295</BodyCRC>
<Topic>test-mq_topic</Topic>
<BornTimestamp>1570760999721</BornTimestamp>
<StoreSize>406</StoreSize>
<PropertyList>
<MessageProperty>
<Name>TAGS</Name>
<Value>TagA</Value>
</MessageProperty>
</PropertyList>
</OnsRestMessageDo>
</MsgFoundList>
<TaskId>0BC1310300002A9F000021E4D7A48346</TaskId>
<CurrentPage>1</CurrentPage>
</MsgFoundDo>
<RequestId>5DC2A47E-2B31-4722-96C8-FA59C9*****</RequestId>
</OnsDLQMessagePageQueryByGroupIdResponse>
JSON
format
{
"OnsDLQMessagePageQueryByGroupIdResponse": {
"MsgFoundDo": {
"MaxPageCount": 400,
"MsgFoundList": {
"OnsRestMessageDo": {
"MsgId": "1E0578FE110F18B4AAC235C05F2*****",
"Body": "SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv",
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"ReconsumeTimes": 1,
"BornHost": "42.120. ***. ***:59270",
"StoreTimestamp": 1570760999811,
"StoreHost": "11.193. ***. ***:10911",
"BodyCRC": 914112295,
"Topic": "test-mq_topic",
"BornTimestamp": 1570760999721,
"StoreSize": 406,
"PropertyList": {
"MessageProperty": [
{
"Name": "TAGS",
"Value": "TagA"
}
]
}
}
},
"TaskId": "0BC1310300002A9F000021E4D7A48346",
"CurrentPage": 1
},
"RequestId": "5DC2A47E-2B31-4722-96C8-FA59C9*****"
}
}
Error codes
For a list of error codes, visit the API Error Center.