Mengkueri Paket dead-letter berdasarkan halaman untuk Group ID dan rentang pengatur waktu tertentu.
Deskripsi operasi
Alibaba Cloud OpenAPI is a management API. You can use it to manage and query Alibaba Cloud service resources. Integrate this API for management purposes only. Do not use this API for core data links that send and receive messages because this can create security threats.
-
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.
-
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:QueryDLQMessage |
get |
Group
Group
|
None |
|
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
string |
Yes |
ID kelompok konsumen yang akan dikueri. |
GID_test_group_id |
| BeginTime |
integer |
Yes |
Awal rentang pengatur waktu yang akan dikueri. Nilai ini adalah Stempel waktu UNIX dalam milidetik.
Jika Anda menentukan |
1570723200000 |
| EndTime |
integer |
Yes |
Akhir rentang pengatur waktu yang akan dikueri. Nilai ini adalah Stempel waktu UNIX dalam milidetik.
Jika Anda menentukan |
1570809600000 |
| TaskId |
string |
No |
ID tugas kueri. Hilangkan parameter ini untuk kueri pertama. Untuk kueri berikutnya, gunakan ID tugas yang dikembalikan oleh kueri sebelumnya. |
0BC1310300002A9F000021E4D7A48346 |
| CurrentPage |
integer |
Yes |
Nomor halaman yang akan dikembalikan. Halaman dimulai dari 1. Nilai dapat mencapai 50 dan tidak boleh melebihi jumlah total halaman. |
2 |
| PageSize |
integer |
No |
Jumlah Paket yang akan dikembalikan pada setiap halaman. Nilai default: 20. Nilai minimum: 5. Nilai maksimum: 50.
Jika Anda menentukan |
5 |
| InstanceId |
string |
No |
ID instans yang berisi Paket. |
MQ_INST_111111111111_DOxxxxxx |
Elemen respons
|
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 information about dead-letter messages that are returned on the current page. The information that is contained in this parameter is the same as the information that is returned by the OnsDLQMessageGetById operation. |
|
|
array<object> |
|||
| StoreSize |
integer |
The size of the message. Unit: KB. |
406 |
| ReconsumeTimes |
integer |
The number of retries that were performed to send the message to consumers. |
1 |
| StoreTimestamp |
integer |
The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message. |
1570760999811 |
| InstanceId |
string |
The ID of the instance |
MQ_INST_111111111111_DOxxxxxx |
| MsgId |
string |
The ID of the message. |
1E0578FE110F18B4AAC235C05F2***** |
| StoreHost |
string |
The ApsaraMQ for RocketMQ broker that stores the message. |
11.193.***.***:10911 |
| Topic |
string |
The topic to which the message belongs. |
test-mq_topic |
| PropertyList |
object |
||
| MessageProperty |
array<object> |
The attributes of the message. |
|
|
object |
|||
| Value |
string |
The value of the attribute. |
TagA |
| Name |
string |
The name of the attribute. Valid values:
For information about the terms that are used in ApsaraMQ for RocketMQ, see Terms. |
TAGS |
| BornTimestamp |
integer |
The timestamp that indicates when the message was produced. |
1570760999721 |
| BodyCRC |
integer |
The cyclic redundancy check (CRC) value of the message body. |
914112295 |
| BornHost |
string |
The producer instance 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 |
Contoh
Respons sukses
JSONformat
{
"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"
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.