Melakukan kueri fuzzy untuk daftar pesan berdasarkan topik dan kunci pesan.
Deskripsi operasi
OpenAPI yang disediakan oleh Alibaba Cloud adalah API manajemen. Anda dapat menggunakannya untuk mengelola dan mengkueri sumber daya layanan Alibaba Cloud. Kami menyarankan agar Anda hanya mengintegrasikan API ini ke dalam jalur data manajemen. Jangan gunakan API ini untuk jalur data inti yang mengirim dan menerima pesan. Hal ini dapat menimbulkan ancaman keamanan pada jalur data Anda.
-
Operasi ini melakukan kueri fuzzy untuk pesan berdasarkan kunci pesan. Karena kunci pesan tidak selalu unik, kueri dapat mengembalikan beberapa pesan.
-
Anda dapat menggunakan operasi ini ketika Anda tidak dapat memperoleh ID pesan. Dalam skenario ini, ikuti langkah-langkah berikut:
-
Panggil operasi ini untuk melakukan kueri fuzzy dan memperoleh daftar ID pesan.
-
Panggil operasi OnsMessageGetByMsgId untuk melakukan kueri istilah. Untuk informasi selengkapnya tentang operasi OnsMessageGetByMsgId, lihat OnsMessageGetByMsgId.
-
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:QueryMessage |
get |
Topic
Topic
|
None |
|
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Topic |
string |
Yes |
Topik pesan yang akan dikueri. |
test-mq_topic |
| Key |
string |
Yes |
Kunci pesan dari pesan yang akan dikueri. |
messageKey1 |
| InstanceId |
string |
No |
ID instance tempat pesan berada. |
MQ_INST_111111111111_DOxxxxxx |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Respons. |
||
| RequestId |
string |
Parameter umum. ID permintaan bersifat unik dan dapat digunakan untuk memecahkan masalah dan menemukan permasalahan. |
A07E3902-B92E-44A6-B6C5-6AA111111**** |
| Data |
object |
||
| OnsRestMessageDo |
array<object> |
Daftar hasil kueri. |
|
|
array<object> |
|||
| StoreSize |
integer |
The size of the message. |
406 |
| ReconsumeTimes |
integer |
The number of retries that were performed to send the message to consumers. |
1 |
| StoreTimestamp |
integer |
The timestamp that indicates 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 client that generated the message. |
42.120.***.***:59270 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "A07E3902-B92E-44A6-B6C5-6AA111111****",
"Data": {
"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"
}
]
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.