All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsConsumerStatus

Last Updated:Feb 04, 2026

This operation queries detailed status data for a specified group ID, including subscription relationship checks, consumption TPS statistics, load balancing status, and consumer-side connections.

Operation description

Important Alibaba Cloud OpenAPIs are management APIs. They manage and query Alibaba Cloud resources. Use them only in management workflows. Do not rely on OpenAPIs in core message publishing or consuming workflows. Doing so may introduce risks.
  • You can use this operation to troubleshoot abnormal consumption after you confirm message accumulation or client online status. The response helps you verify the consistency of subscription relationships for a specified group ID, confirm normal load balancing, and retrieve Jstack information for online clients.

  • This operation calls many backend interfaces to aggregate data, which can cause it to run slowly. Therefore, avoid frequent calls.

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

GID_test_group_id

Detail

boolean

No

Whether to return detailed information. Valid values:

  • true: Return detailed information, including ConsumerConnectionInfoList and DetailInTopicList.

  • false: Default. Do not return detailed information. ConsumerConnectionInfoList and DetailInTopicList are empty.

true

NeedJstack

boolean

No

Whether to print Jstack information. Valid values:

  • true: Print Jstack information. Retrieve stack trace from the Jstack response field.

Note

To print Jstack information, set the Detail request parameter to true.

  • false: Default. Do not print Jstack information. The Jstack response field is empty.

true

InstanceId

string

No

The instance ID associated with the group ID to query.

MQ_INST_111111111111_DOxxxxxx

Response elements

Element

Type

Description

Example

object

RequestId

string

A common parameter. Each request has a unique ID. Use it to locate and troubleshoot issues.

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

Data

object

The query result.

ConsumeTps

number

Total consumption TPS.

0

ConsumeModel

string

The consumption model. Valid values:

  • CLUSTERING: Clustering consumption mode

  • BROADCASTING: Broadcasting consumption mode

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

CLUSTERING

ConnectionSet

object

ConnectionDo

array<object>

Information about currently online clients in the cluster.

object

RemoteIP

string

The host IP address or public IP address.

42.120.74.**

Version

string

The consumer version.

V4_3_6_SNAPSHOT

ClientAddr

string

The address and port of the consumer instance.

30.5.121.**

Language

string

The consumer language.

JAVA

ClientId

string

The ID of the consumer instance.

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

Diff

integer

100

TotalDiff

integer

Total message accumulation across the cluster.

197

ConsumerConnectionInfoList

object

ConsumerConnectionInfoDo

array<object>

Detailed information about online clients in the cluster, including Jstack and consumption RT. To get this information, set the Detail request parameter to true. Otherwise, the response is empty.

array<object>

test, this content is not published to ICMS

ConsumeModel

string

The consumption model. Valid values:

  • CLUSTERING: Clustering consumption mode

  • BROADCASTING: Broadcasting consumption mode

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

CLUSTERING

RunningDataList

object

ConsumerRunningDataDo

array<object>

Real-time status statistics.

object

Rt

number

Consumption response time (RT), in milliseconds.

0

Topic

string

The name of the subscribed topic.

test-mq_topic

FailedCountPerHour

integer

Number of messages that failed to consume per hour.

0

OkTps

number

TPS for successfully consumed messages.

0

FailedTps

number

TPS for messages that failed to consume.

0

SubscriptionSet

object

SubscriptionData

array<object>

The collection of subscription relationships.

array<object>

SubString

string

The tag expression used to subscribe to the topic.

*

SubVersion

integer

The subscription relationship version number. This is an auto-incrementing long integer.

1570701364301

Topic

string

The name of the subscribed topic.

test-mq_topic

TagsSet

object

Tag

array

The collection of subscribed tags.

string

The collection of subscribed tags.

ff

Jstack

object

ThreadTrackDo

array<object>

Jstack stack trace. To get Jstack information, set the NeedJstack request parameter to true. Otherwise, the response is empty.

array<object>

test—this content is not published to ICMS

TrackList

object

Track

array

The Jstack stack trace string.

string

The Jstack stack trace string.

TID: 52 STATE: WAITING

Thread

string

The thread name.

ConsumeMessageThread_0

LastTimeStamp

integer

The timestamp of the last consumption.

This value uses millisecond-level Unix timestamps.

1570701368114

StartTimeStamp

integer

The timestamp when consumption started.

This value uses millisecond-level Unix timestamps.

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 number.

V4_3_6

ConsumeType

string

The message consumption mode. Valid values:

  • PUSH: ApsaraMQ for RocketMQ pushes messages to consumers.

  • PULL: Consumers pull messages from ApsaraMQ for RocketMQ.

PUSH

ThreadCount

integer

The number of consumption threads.

20

InstanceId

string

The instance ID.

MQ_INST_111111111111_DOxxxxxx

DetailInTopicList

object

DetailInTopicDo

array<object>

Consumption details for each topic. To get this information, set the Detail request parameter to true. Otherwise, the response is empty.

object

DelayTime

integer

The consumption delay time for the specified topic, in milliseconds.

0

TotalDiff

integer

The total message accumulation for the topic.

0

LastTimestamp

integer

The timestamp of the last consumption.

This value uses millisecond-level Unix timestamps.

1570701259403

Topic

string

The topic name.

test-mq_topic

SubscriptionSame

boolean

Whether subscription relationships are consistent.

true

DelayTime

integer

The maximum consumption delay time across all topics subscribed to by the specified group ID, in milliseconds.

100857

LastTimestamp

integer

The timestamp of the last consumption.

This value uses millisecond-level Unix timestamps.

1566883844954

Online

boolean

Whether the client is online.

true

RebalanceOK

boolean

Whether 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.