All Products
Search
Document Center

OnsConsumerStatus

Last Updated: Apr 17, 2019

OnsConsumerStatus

You can call this operation to query the detailed status of a specified group ID, including subscription consistency, consumption TPS, load balancing, and consumer connection status.

Description

When calling this operation, pay attention to the following:

  • The operation is called to locate causes of abnormal consumption after roughly determining whether messages are accumulated and whether consumers are online. You can determine whether subscriptions under a specified group ID are consistent and whether load balancing is normal, and obtain Jstack information of online clients.

  • The operation requires a lot of backend methods for data aggregation. Therefore, the system responds slowly. We recommend that you do not frequently call this operation.

Request parameters

Name Type Required Description
InstanceId String No The ID of the instance.
PreventCache Long Yes The parameter used for CSRF verification, which can be set to the current system time. Unit: ms
GroupId String Yes The group ID of the consumer you want to query.
Detail Boolean No Indicates whether to query the details. Valid values:
  • true: Query details.
  • false: Do not query details.
NeedJstack Boolean No Indicates whether to print Jstack information.

Response parameters

Name Type Description
RequestId String A common parameter. Each request has a unique ID.
HelpUrl String A help link.
Data ConsumerStatusDo The query results.

Fields in ConsumerStatusDo

Name Type Description
Online Boolean Indicates whether a consumer is online.
TotalDiff Long The total message accumulation amount of the cluster.
ConsumeTps Long The total consumption TPS.
LastTimestamp Long The last update time.
DelayTime Long The consumption latency.
ConsumeModel Long The consumption model.
SubscriptionSame Boolean Indicates whether subscriptions are consistent.
RebalanceOK Boolean Indicates whether the client load balancing is normal. Valid values:
  • true: normal
  • false: abnormal
ConnectionSet List(ConnectionDo) Information about clients in the cluster that are currently online.
DetailInTopicList List(DetailInTopicDo) The consumption status corresponding to each topic.
ConsumerConnectionInfoList List(ConsumerConnectionInfoDo) Details about clients in the cluster that are currently online, including Jstack and consumption response time (RT).

Fields in ConnectionDo

Name Type Description
ClientId String The ID of the consumer instance.
ClientAddr String The address and port of the consumer instance.
Language String The language used by the consumer client.
Version String The version of the consumer client.
RemoteIP String The host or Internet IP address

Fields in DetailInTopicDo

Name Type Description
Topic String The name of the topic.
TotalDiff Long The total consumption accumulation amount corresponding to the topic.
LastTimestamp Long The last update time.
DelayTime Long The consumption latency.

Fields in ConsumerConnectionInfoDo

Name Type Description
ClientId String The ID of the consumer instance.
Connection String The client connection information.
Language String The language used by the client.
Version String The version of the client.
ConsumeModel String The consumption type. Valid values:
  • CLUSTERING: clustering consumption
  • BROADCASTING: broadcasting consumption
ConsumeType String Indicates the consumption start point.
ThreadCount Integer The number of consumption threads.
StartTimeStamp Long The consumption start time.
LastTimeStamp Long The last update time.
SubscriptionSet List(SubscriptionData) A set of subscriptions.
RunningDataList List(ConsumerRunningDataDo) Real-time status statistics.
Jstack List(ThreadTrackDo) Jstack information.

Fields in SubscriptionData

Name Type Description
Topic String The name of the topic the group ID subscribed to.
SubString String The tag under the topic the group ID subscribed to.
SubVersion Long The subscription version, which is an automatically incremented long parameter.
TagsSet List(String) A set of tags the group ID subscribed to.

Fields in ConsumerRunningDataDo

Name Type Description
GroupId String The group ID of the consumer.
Topic String The name of the topic the group ID subscribed to.
Rt Float The consumption RT. Unit: ms.
OkTps Float The TPS statistics of successful message consumption.
FailedTps Float The TPS statistics of message consumption failures.
FailedCountPerHour Long The number of messages that failed to be consumed per hour.

Fields in ThreadTrackDo

Name Type Description
Thread String The name of the thread.
TrackList List(String) The Jstack string.

Examples

For more information about sample codes, see API sample code and endpoints.