All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsConsumerAccumulate

Last Updated:Jan 04, 2026

Queries the message accumulation for a specified group ID. The results include the number of stacked messages and the consumption latency.

Operation description

Important Alibaba Cloud OpenAPI is a management API used to manage and query Alibaba Cloud service resources. Integrate this API only into your management data link. Do not use this API in the core data link for sending and receiving messages to avoid potential threats.
You can use the message accumulation query in a production environment to monitor the consumption progress of a group ID. This outlines the message consumption status and latency. You can query the message accumulation for all topics to which the group ID subscribes, or for each individual topic.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mq:QueryConsumerAccumulate

get

Group

acs:mq:{#regionId}:{#accountId}:{#GroupName}

Group

acs:mq:{#regionId}:{#accountId}:{#InstanceId}%{#GroupName}

None
  • mq:OnsInstanceBaseInfo

Request parameters

Parameter

Type

Required

Description

Example

GroupId

string

Yes

The ID of the Group that you want to query.

GID_test_consumer_id

Detail

boolean

No

Specifies whether to query the details of each topic. Valid values:

  • true: Queries the details. The details are returned in the DetailInTopicList parameter.

  • false: Does not query the details. This is the default value. The DetailInTopicList parameter returns empty.

true

InstanceId

string

No

The instance ID.

MQ_INST_111111111111_DOxxxxxx

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. This is a common parameter. Each request has a unique ID. Use this ID to locate and troubleshoot issues.

CE817BFF-B389-43CD-9419-95011AC9****

Data

object

The message accumulation of the specified consumer.

ConsumeTps

number

The total TPS of message consumption for the group of consumer instances that belong to the specified Group ID.

10

DelayTime

integer

The maximum message consumption latency for the Group ID. The value is the longest consumption latency among all topics to which the Group ID subscribes.

Unit: milliseconds.

10000

LastTimestamp

integer

The production time of the most recently consumed message in the group of consumer instances that belong to the specified Group ID.

Unit: Unix timestamp in milliseconds.

1566231000000

TotalDiff

integer

The number of stacked messages for all topics to which the Group ID subscribes.

100

Online

boolean

Indicates whether a consumer instance is online under this Group ID. If at least one consumer instance is online, the Group ID is considered online. Valid values:

  • true: Online

  • false: Offline

true

DetailInTopicList

object

DetailInTopicDo

array<object>

The details of each topic. If the Detail parameter in the request is set to false, this parameter returns empty.

object

DelayTime

integer

The maximum message consumption latency in this topic. This is the time difference between the ready time of the earliest unconsumed message in the topic and the current time.

Unit: milliseconds.

10000

TotalDiff

integer

The number of stacked messages in the topic.

100

LastTimestamp

integer

The production time of the most recently consumed message in the topic.

Unit: Unix timestamp in milliseconds.

1566231000000

Topic

string

The topic name.

test-mq-topic

Examples

Success response

JSON format

{
  "RequestId": "CE817BFF-B389-43CD-9419-95011AC9****",
  "Data": {
    "ConsumeTps": 10,
    "DelayTime": 10000,
    "LastTimestamp": 1566231000000,
    "TotalDiff": 100,
    "Online": true,
    "DetailInTopicList": {
      "DetailInTopicDo": [
        {
          "DelayTime": 10000,
          "TotalDiff": 100,
          "LastTimestamp": 1566231000000,
          "Topic": "test-mq-topic"
        }
      ]
    }
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.