You can call this operation to query the message accumulation information for a specified group ID, including the current number of accumulated messages and the consumption latency.

Consumption accumulation is usually queried when the consumption progress of consumers with a specified group ID in the production environment needs to be learned to roughly determine the message consumption status and latency. You can check not only the message accumulation information of all topics to which the specified group ID has subscribed, but also the message accumulation information of each topic.

If you want to query the consumption status of each online consumer instance with the group ID, call the OnsConsumerStatus operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes OnsConsumerAccumulate

The operation that you want to perform. Set the value to OnsConsumerAccumulate.

GroupId String Yes GID_test_consumer_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 group ID.

Detail Boolean No true

Specifies whether to query the details about each topic to which the consumer group has subscribed. Valid values:

  • true: Queries the details. The returned DetailInTopicList parameter contains the detailed information.
  • false: does not query the details. The value is the default value. The returned DetailInTopicList parameter is empty.

Response parameters

Parameter Type Example Description
Data Struct

The message accumulation information of the consumer group that was queried.

ConsumeTps Float 10

The total transactions per second (TPS) for messages received by the consumer group corresponding to the group ID.

DelayTime Long 10000

The consumption latency of the consumer group corresponding to the group ID.

DetailInTopicList Array

Details about each topic to which the specified group ID has subscribed. If the Detail parameter in the request is set to false, the returned value of this parameter is empty.

DetailInTopicDo
DelayTime Long 10000

The maximum consumption latency of messages in the topic.

LastTimestamp Long 1566231000000

The production time of the latest consumed message in the topic.

Topic String test-mq-topic

The name of the topic.

TotalDiff Long 100

The number of accumulated messages corresponding to the topic.

LastTimestamp Long 1566231000000

The production time of the last message consumed in the consumer group corresponding to the group ID.

Online Boolean true

Indicates whether any consumer instance under the group ID is online. The group ID is online provided that at least one of the consumer instances under the group ID is online. Valid values:

  • true: online
  • false: offline
TotalDiff Long 100

The total number of accumulated messages corresponding to all the topics to which the consumer group has subscribed.

RequestId String CE817BFF-B389-43CD-9419-95011AC9D5E8

The ID of the request. This is a common parameter.

Examples

Sample requests

http(s)://[Endpoint]/? Action=OnsConsumerAccumulate
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&GroupId=GID_test_consumer_id
&Detail=true
&<Common request parameters>

Sample success responses

XML format

<OnsConsumerAccumulateResponse>
  <Data>
        <DetailInTopicList>
              <DetailInTopicDo>
                    <TotalDiff>100</TotalDiff>
                    <LastTimestamp>1566231000000</LastTimestamp>
                    <DelayTime>10000</DelayTime>
                    <Topic>test-mq-topic</Topic>
              </DetailInTopicDo>
        </DetailInTopicList>
        <TotalDiff>100</TotalDiff>
        <LastTimestamp>1566231000000</LastTimestamp>
        <DelayTime>10000</DelayTime>
        <Online>true</Online>
        <ConsumeTps>10</ConsumeTps>
  </Data>
  <RequestId>0CCF6437-CBB0-4378-BFEC-E08AC2583589</RequestId>
</OnsConsumerAccumulateResponse>

JSON format

{
  "Data": {
    "DetailInTopicList": {
      "DetailInTopicDo": [
        {
          "TotalDiff": 100,
          "LastTimestamp": 1566231000000,
          "DelayTime": 10000,
          "Topic": "test-mq-topic"
        }
      ]
    },
    "TotalDiff": 100,
    "LastTimestamp": 1566231000000,
    "DelayTime": 10000,
    "Online": true,
    "ConsumeTps": 10
  },
  "RequestId": "0CCF6437-CBB0-4378-BFEC-E08AC2583589"
}

Error codes

For a list of error codes, visit the API Error Center.