All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsConsumerAccumulate

最終更新日:Mar 03, 2024

Queries the information about message accumulation in topics to which a specified consumer group subscribes. The returned information includes the number of accumulated messages and the consumption latency.

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.

You can call this operation in scenarios in which you want to know the message consumption progress of a specified consumer group in production environments. You can obtain the information about message consumption and consumption latency based on the returned information. This operation returns the total number of accumulated messages in all topics to which the specified consumer group subscribes and the number of accumulated messages in each topic.

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:QueryConsumerAccumulateRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
GroupIdstringYes

The ID of the consumer group.

GID_test_consumer_id
DetailbooleanNo

Specifies whether to query the details of each topic to which the consumer group subscribes. Valid values:

  • true: The details of each topic are queried. You can obtain the details from the DetailInTopicList response parameter.
  • false: The details of each topic are not queried. This is the default value. If you use this value, the value of the DetailInTopicList response parameter is empty.
true
InstanceIdstringYes

The ID of the instance.

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.

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

The message accumulation information about topics to which the specified consumer subscribes.

ConsumeTpsfloat

The transactions per second (TPS) for message consumption performed by consumers in the group.

10
DelayTimelong

The consumption latency.

10000
LastTimestamplong

The point in time when the latest message consumed by a consumer in the consumer group was produced.

1566231000000
TotalDifflong

The total number of accumulated messages in all topics to which the consumer group subscribes.

100
Onlineboolean

Indicates whether the consumer group is online. The consumer group is online if one of the consumers in the group is online. Valid values:

  • true: The consumer group is online.
  • false: The consumer group is offline.
true
DetailInTopicListobject []

The information about each topic to which the consumer group subscribes. If the Detail parameter in the request is set to false, the value of this parameter is empty.

DelayTimelong

The maximum latency of message consumption in the topic.

10000
TotalDifflong

The number of accumulated messages in the topic.

100
LastTimestamplong

The point in time when the latest consumed message in the topic was produced.

1566231000000
Topicstring

The topic name.

test-mq-topic

Examples

Sample success responses

JSONformat

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

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

Change history

Change timeSummary of changesOperation
No change history

View the information about message accumulation in the console

You can also view the information about message accumulation in topics to which a consumer group subscribes in the ApsaraMQ for RocketMQ console. For more information, see View the status of consumers.