API Introduction
Used to query the messages about a topic within a specified period.
API Restrictions
None.
URl
GET https://[endpoint]/v2/message/queryByTime
Request Parameters
Request Parameters | Required or Not | Position | Parameter Type | Description |
prodInstId | Yes | url | String | Instance ID |
topicName | Yes | url | String | Topic Name |
beginTime | Yes | url | long | Millisecond timestamp of start time |
endTime | Yes | url | long | Millisecond timestamp for end time |
Response Parameter
Response Parameter | Parameter Type | Description |
statusCode | String | The status code of the interface on the system layer. Success: 800; failure: 900. |
message | String | Status Description |
returnObj | String | Return the object. The parameters included in this parameter are described in the comments in Response Examples. |
Description of Return Value returnObj
Response Parameter | Parameter Type | Description |
total | Int | Total |
rows | List | List of Messages |
Description of Return Value rows
Response Parameter | Parameter Type | Description |
queueId | Int | Queue ID |
storeSize | Int | Message Size |
queueOffset | Long | Queue Offset |
sysFlag | Int | System Flag |
bornTimestamp | Long | Generation Timestamp, in milliseconds. |
bornHost | String | Generation Host |
storeTimestamp | Long | Storage Timestamp, in milliseconds. |
msgId | String | Message ID |
commitLogOffset | Long | Physical Offset |
bodyCRC | Int | Body CRC |
reconsumeTimes | Int | Number of Retries |
preparedTransactionOffset | Long | Transaction Offset |
properties | Map<String, String> | MIN_OFFSET: min offset MAX_OFFSET: max offset UNIQ_KEY: indicates the unique key |
messageBody | String | Message body |
status | String | Consumption Status: TO_CONSUME: Not consumed CONSUMING: Consuming CONSUMED: Consumed |
Sample Request
GET https://[endpoint]/v2/message/ queryByKey? topicName=test_key&prodInstId=70687660456281088&beginTime=1652841984000group&endTime=1652842984000
Examples of a Successful Response
{
"returnObj":{
"total":1,
"rows":[
{
"queueId":0,
"storeSize":967,
"queueOffset":4,
"sysFlag":0,
"bornTimestamp":1660564149558,
"bornHost":"192.168.71.1:60905",
"storeTimestamp":1660564149566,
"storeHost":"192.168.71.188:8422",
"msgId":"C0A847BC000020E60000000000003C27",
"commitLogOffset":15399,
"bodyCRC":1729222146,
"reconsumeTimes":0,
"preparedTransactionOffset":0,
"topic":"test",
"properties":{
"MIN_OFFSET":"0",
"MAX_OFFSET":"6",
"UNIQ_KEY":"0505CD4343C018B4AAC24C59BD360002"
},
"messageBody":"mmfyJPna5ArnW0KcqP5QQErMYmfdYMVSn699eWZqLFk07AjzBN2eTK0cEtcicngBvKMegX76OwddTRqkdOxVMgLLNdqTG41UwLKJt1a4NnuWDiiyXklnMZ0ZC1ftWEgvdggeJu8k9hhK2wBQZrbfFIX0VrvINXqj0M77mQ8NA6QLojhUlzdbvSZT3mAsZUY3j45jAKFrCgnlGKdzgIz9s5vELpb3N6pyrSeKBrTaQV0wVEG4rzPRMQcfmYMy9bneQLVMZDp7bIsFdE8cpsktR0Uk58ofP0U3KTEkcg3Tkrtx6Hd7eFKUtS7Kxuci18V9BCisO6gKBUpVyKsWP4eB9FJ4r2Jo5oFNLotl3gq9nPhrpkgSIV3TzBINCokLzTAHrpftt3W3VU4OrRcpFFAMcDWlVDWfpG8VXm1QjnVJCWsDIeMAvEUuauU9D8vkHeYen7uR9a3dCgFiwWQOO6MXPxAiV5XFaz3Tmo87G9J01SdH3o1B2p8E67f2zdVoqU1RxrzTnar3ubbTabMs6B6gjfuoA0QZcaTtROseYsGu8uKrVVRqL3fgB5XbGWULQ8AFEOn3MsEEaNe5HxchutMAf0uj2GhYg7SyDp832OXaBzbRu07cI3BA7P2pa0nNPBprwB0YYNLZLOaf5nYOY3sytbIQdy7CH9YqRcEgUK0NWXAtqlnYhdVFzRSaWEwhvuCn1mISWik4HhfhFepmpZztB5dsII8F4LpjIk4e0iDDtXDZGtPFlpTaLaSFEPRfuPWkWK7VkHL5NHk86b9uFIlXlPJC5SoXp6c2Gyh34ZufH63aHJv7kM",
"status":null
}
]
},
"message":"success",
"statusCode":800
}
Example of a Failed Response
{
"returnObj": {},
"message": "...",
"statusCode": "900"
}