All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsConsumerStatus

Last Updated:Oct 26, 2026

Queries the detailed status data of a specified group ID, including subscription consistency check, consumption TPS statistics, load balancing status, and consumer connections.

Operation description

Important OpenAPI operations provided by Alibaba Cloud are management and control API operations used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only into management and control links. Do not rely on OpenAPI operations in the core data link for message sending and receiving. Otherwise, risks may occur in the link.
  • This operation is typically used to troubleshoot the causes of consumption exceptions after a rough check on message accumulation and client online status. Based on the returned results, you can determine whether the subscription relationships of the specified group ID are consistent, whether load balancing is normal, and obtain the Jstack information of online clients.

  • This operation calls a large number of backend API operations to aggregate data. Therefore, the query speed is slow. Do not call this operation frequently.

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:QueryConsumerStatus

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 consumer group to query.

GID_test_group_id

Detail

boolean

No

Specifies whether to query detailed information. Valid values:

  • true: Queries detailed information. You can obtain the ConsumerConnectionInfoList and DetailInTopicList response parameters.

  • false: Does not query detailed information. This is the default value. The ConsumerConnectionInfoList and DetailInTopicList response parameters are empty.

true

NeedJstack

boolean

No

Specifies whether to print Jstack information. Valid values:

  • true: Prints Jstack information. You can obtain the stack information from the Jstack response parameter.

Note

To print Jstack information, make sure that the Detail request parameter is set to true.

  • false: Does not print Jstack information. This is the default value. The Jstack response parameter is empty.

true

InstanceId

string

No

The instance ID corresponding to the Group ID to query.

MQ_INST_111111111111_DOxxxxxx

Response elements

Element

Type

Description

Example

object

RequestId

string

The common parameter. The ID of each request is unique and can be used to troubleshoot and locate issues.

10EDC518-10E7-4B34-92FB-171235FA****

Data

object

The query results.

ConsumeTps

number

The total consumption TPS.

0

ConsumeModel

string

The consumption model. Valid values:

  • CLUSTERING: clustering consumption mode.

  • BROADCASTING: broadcasting consumption mode.

For more information about the two subscription modes, see Clustering consumption and broadcasting consumption.

CLUSTERING

ConnectionSet

object

ConnectionDo

array<object>

The information about the online clients in the cluster.

object

RemoteIP

string

The IP address of the host or the public IP address.

42.120.74.**

Version

string

The version of the consumer.

V4_3_6_SNAPSHOT

ClientAddr

string

The IP address and port of the consumer instance.

30.5.121.**

Language

string

The language of the consumer.

JAVA

ClientId

string

The ID of the consumer instance.

30.5.121.**@25560#-1999745829#-1737591554#458773089270275

Diff

integer

The number of accumulated messages per client.

100

TotalDiff

integer

The total message accumulation in the cluster.

197

ConsumerConnectionInfoList

object

ConsumerConnectionInfoDo

array<object>

The detailed information about the online clients in the cluster, including Jstack and consumption response time (RT). To obtain the detailed information, make sure that the Detail request parameter is set to true. Otherwise, the returned value is empty.

array<object>

The test content. This content is not pushed to ICMS.

ConsumeModel

string

The consumption model. Valid values:

  • CLUSTERING: clustering consumption mode.

  • BROADCASTING: broadcasting consumption mode.

For more information about the two subscription modes, see Clustering consumption and broadcasting consumption.

CLUSTERING

RunningDataList

object

ConsumerRunningDataDo

array<object>

The real-time status statistics.

object

Rt

number

The consumption RT. Unit: milliseconds.

0

Topic

string

The name of the subscribed topic.

test-mq_topic

FailedCountPerHour

integer

The number of messages that failed to be consumed per hour.

0

OkTps

number

The TPS of successfully consumed messages.

0

FailedTps

number

The TPS of messages that failed to be consumed.

0

SubscriptionSet

object

SubscriptionData

array<object>

The subscription relationship set.

array<object>

SubString

string

The tag expression for the subcategory of the subscribed topic.

*

SubVersion

integer

The version number of the subscription relationship. The value is an auto-incrementing long integer.

1570701364301

Topic

string

The name of the subscribed topic.

test-mq_topic

TagsSet

object

Tag

array

The set of subscribed tags.

string

The set of subscribed tags.

ff

Jstack

object

ThreadTrackDo

array<object>

The Jstack information. To obtain the Jstack information, make sure that the NeedJstack request parameter is set to true. Otherwise, the returned value is empty.

array<object>

The test content. This content is not published to ICMS.

TrackList

object

Track

array

The Jstack information string.

string

The Jstack information string.

TID: 52 STATE: WAITING

Thread

string

The thread name.

ConsumeMessageThread_0

LastTimeStamp

integer

The last consumption time. The value is a UNIX timestamp in milliseconds.

1570701368114

StartTimeStamp

integer

The consumption start time. The value is a UNIX timestamp in milliseconds.

1570701361528

Language

string

The client language.

JAVA

ClientId

string

The ID of the consumer instance.

30.5.**.**@25560#-1999745829#-1737591554#458773089270275

Connection

string

The connection information.

**

Version

string

The client version.

V4_3_6

ConsumeType

string

The message consumption mode of the consumer. Valid values:

  • PUSH: The ApsaraMQ for RocketMQ server pushes messages to the consumer.

  • PULL: The consumer pulls messages from the ApsaraMQ for RocketMQ server.

PUSH

ThreadCount

integer

The number of consumption threads.

20

InstanceId

string

The instance ID.

MQ_INST_111111111111_DOxxxxxx

DetailInTopicList

object

DetailInTopicDo

array<object>

The consumption status of each topic. To obtain the detailed information, make sure that the Detail request parameter is set to true. Otherwise, the returned value is empty.

object

DelayTime

integer

The consumption delay time of the specified topic. Unit: milliseconds.

0

TotalDiff

integer

The total number of accumulated messages for the topic.

0

LastTimestamp

integer

The last consumption time. The value is a UNIX timestamp in milliseconds.

1570701259403

Topic

string

The topic name.

test-mq_topic

SubscriptionSame

boolean

Indicates whether the subscription relationships are consistent.

true

DelayTime

integer

The maximum consumption delay time among all topics subscribed by the specified group ID. Unit: milliseconds.

100857

LastTimestamp

integer

The last consumption time. The value is a UNIX timestamp in milliseconds.

1566883844954

Online

boolean

Indicates whether the client is online.

true

RebalanceOK

boolean

Indicates whether client rebalancing is normal. Valid values:

  • true: Normal.

  • false: Abnormal.

true

Examples

Success response

JSON format

{
  "RequestId": "10EDC518-10E7-4B34-92FB-171235FA****",
  "Data": {
    "ConsumeTps": 0,
    "ConsumeModel": "CLUSTERING",
    "ConnectionSet": {
      "ConnectionDo": [
        {
          "RemoteIP": "42.120.74.**",
          "Version": "V4_3_6_SNAPSHOT",
          "ClientAddr": "30.5.121.**",
          "Language": "JAVA",
          "ClientId": "30.5.121.**@25560#-1999745829#-1737591554#458773089270275",
          "Diff": 100
        }
      ]
    },
    "TotalDiff": 197,
    "ConsumerConnectionInfoList": {
      "ConsumerConnectionInfoDo": [
        {
          "ConsumeModel": "CLUSTERING",
          "RunningDataList": {
            "ConsumerRunningDataDo": [
              {
                "Rt": 0,
                "Topic": "test-mq_topic",
                "FailedCountPerHour": 0,
                "OkTps": 0,
                "FailedTps": 0
              }
            ]
          },
          "SubscriptionSet": {
            "SubscriptionData": [
              {
                "SubString": "*",
                "SubVersion": 1570701364301,
                "Topic": "test-mq_topic",
                "TagsSet": {
                  "Tag": [
                    "ff"
                  ]
                }
              }
            ]
          },
          "Jstack": {
            "ThreadTrackDo": [
              {
                "TrackList": {
                  "Track": [
                    "TID: 52 STATE: WAITING"
                  ]
                },
                "Thread": "ConsumeMessageThread_0"
              }
            ]
          },
          "LastTimeStamp": 1570701368114,
          "StartTimeStamp": 1570701361528,
          "Language": "JAVA",
          "ClientId": "30.5.**.**@25560#-1999745829#-1737591554#458773089270275",
          "Connection": "**",
          "Version": "V4_3_6",
          "ConsumeType": "PUSH",
          "ThreadCount": 20
        }
      ]
    },
    "InstanceId": "MQ_INST_111111111111_DOxxxxxx",
    "DetailInTopicList": {
      "DetailInTopicDo": [
        {
          "DelayTime": 0,
          "TotalDiff": 0,
          "LastTimestamp": 1570701259403,
          "Topic": "test-mq_topic"
        }
      ]
    },
    "SubscriptionSame": true,
    "DelayTime": 100857,
    "LastTimestamp": 1566883844954,
    "Online": true,
    "RebalanceOK": true
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.