You can call this operation to query online consumer groups that have subscribed to a specified topic.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes OnsTopicSubDetail

The operation that you want to perform. Set the value to OnsTopicSubDetail.

InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance corresponding to the topic that you want to query.

Topic String Yes test

The name of the topic that you want to query.

Response parameters

Parameter Type Example Description
Data Struct

The returned data object.

SubscriptionDataList Array

All the returned online consumer groups that have subscribed to the queried topic.

SubscriptionDataList
GroupId String GID_test

The ID of the consumer group that has subscribed to the topic.

MessageModel String CLUSTERING

The consumption pattern of the consumer group that has subscribed to the topic. Valid values:

  • CLUSTERING: clustering consumption
  • BROADCASTING: broadcasting consumption
SubString String *

The subscription expression of the consumer group that has subscribed to the topic.

Topic String test

The name of the topic that was queried.

RequestId String 87B6207F-2908-42B5-A134-84956DCABF3D

The ID of the request. This is a common parameter.

Examples

Sample requests

http(s)://[Endpoint]/? Action=OnsTopicSubDetail
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Topic=test
&<Common request parameters>

Sample success responses

XML format

<OnsTopicSubDetailResponse>
  <Data>
        <Topic>test</Topic>
        <SubscriptionDataList>
              <SubscriptionDataList>
                    <SubString>*</SubString>
                    <MessageModel>CLUSTERING</MessageModel>
                    <GroupId>GID_test</GroupId>
              </SubscriptionDataList>
        </SubscriptionDataList>
  </Data>
  <RequestId>87B6207F-2908-42B5-A134-84956DCABF3D</RequestId>
</OnsTopicSubDetailResponse>

JSON format

{
	"Data": {
		"Topic": "test",
		"SubscriptionDataList": {
			"SubscriptionDataList": [
				{
					"SubString": "*",
					"MessageModel": "CLUSTERING",
					"GroupId": "GID_test"
				}
			]
		}
	},
	"RequestId": "87B6207F-2908-42B5-A134-84956DCABF3D"
}

Error codes

For a list of error codes, visit the API Error Center.