All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsDLQMessagePageQueryByGroupId

Last Updated:Mar 03, 2024

Queries all dead-letter messages in a group within a period of time by page.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.
  • If you do not know the ID of the dead-letter message that you want to query, you can call this operation to query all dead-letter messages that are sent to a specified consumer group within a specified time range. The results are returned by page.

  • We recommend that you specify a short time range to query dead-letter messages in this method. If you specify a long time range, a large number of dead-letter messages are returned. In this case, you cannot find the dead-letter message that you want to query in an efficient manner. You can perform the following steps to query dead-letter messages:

    1. Perform a paged query by specifying the group ID, start time, end time, and number of entries to return on each page. If matched messages are found, the information about the dead-letter messages on the first page, total number of pages, and task ID are returned by default.
    2. Specify the task ID and a page number to call this operation again to query the dead-letter messages on the specified page. In this query, the BeginTime, EndTime, and PageSize parameters do not take effect. By default, the system uses the values of these parameters that you specified in the request when you created the specified query task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mq:QueryDLQMessageRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
GroupIdstringYes

The ID of the consumer group whose dead-letter messages you want to query.

GID_test_group_id
BeginTimelongYes

The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. If you specify a valid value for the TaskId parameter in the request, this parameter does not take effect. The system uses the value of the BeginTime parameter that you specified in the request when you created the specified query task.

1570723200000
EndTimelongYes

The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. If you specify a valid value for the TaskId parameter in the request, this parameter does not take effect. The system uses the value of the EndTime parameter that you specified in the request when you created the specified query task.

1570809600000
TaskIdstringNo

The ID of the query task. The first time you call this operation to query dead-letter messages that are sent to a specified consumer group within a specified time range, this parameter is not required. This parameter is required in subsequent queries for dead-letter messages on a specified page. You can obtain the task ID from the returned result of the first query.

0BC1310300002A9F000021E4D7A48346
CurrentPageintegerYes

The number of the page to return. Pages start from page 1. Valid values: 1 to 50.

2
PageSizeintegerNo

The number of dead-letter messages to return on each page. Valid values: 5 to 50. Default value: 20. If you specify a valid value for the TaskId parameter in the request, this parameter does not take effect. The system uses the value of the PageSize parameter that you specified in the request when you created the specified query task.

5
InstanceIdstringYes

The ID of the instance to which the dead-letter messages you want to query belong.

MQ_INST_111111111111_DOxxxxxx

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.

B00CD3C8-D81E-4A41-85E2-38F19252****
MsgFoundDoobject

The information about dead-letter messages that are queried.

CurrentPagelong

The page number of the returned page.

1
MsgFoundListobject []

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.

StoreSizeinteger

The size of the message. Unit: KB.

406
ReconsumeTimesinteger

The number of retries that were performed to send the message to consumers.

1
StoreTimestamplong

The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message.

1570760999811
InstanceIdstring

The ID of the instance

MQ_INST_111111111111_DOxxxxxx
MsgIdstring

The ID of the message.

1E0578FE110F18B4AAC235C05F2*****
StoreHoststring

The ApsaraMQ for RocketMQ broker that stores the message.

11.193.***.***:10911
Topicstring

The topic to which the message belongs.

test-mq_topic
PropertyListobject []

The attributes of the message.

Valuestring

The value of the attribute.

TagA
Namestring

The name of the attribute. Valid values:

  • TRACE_ON: indicates whether a trace of the message exists.
  • KEYS: indicates the key of the message.
  • TAGS: indicates the tag that is attached to the message.
  • INSTANCE_ID: indicates the ID of the instance that contains the message.

For information about the terms that are used in ApsaraMQ for RocketMQ, see Terms .

TAGS
BornTimestamplong

The timestamp that indicates when the message was produced.

1570760999721
BodyCRCinteger

The cyclic redundancy check (CRC) value of the message body.

914112295
BornHoststring

The producer instance that generated the message.

42.120.***.***:59270
MaxPageCountlong

The total number of returned pages.

400
TaskIdstring

The ID of the query task. The first time you call this operation to query the dead-letter messages that are sent to a specified consumer group within a specified time range, this parameter is returned. You can use the task ID to query the details of dead-letter messages on other returned pages.

0BC1310300002A9F000021E4D7A48346

Examples

Sample success responses

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"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history

View dead-letter messages in the console

You can also view the dead-letter messages of a consumer group in the ApsaraMQ for RocketMQ console.**** For more information, see Dead-letter queues.