Queries the information of a consumer group, including the consumer group ID, consumer group name, username, and message latency.

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 DescribeConsumerChannel

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

RegionId String Yes cn-hangzhou

The ID of the region in which the change tracking instance resides. For more information, see List of supported regions.

DtsInstanceId String No dtsboss6pn1w******

The ID of the change tracking instance. You can call the DescribeDtsJobs operation to query the instance ID.

Note You must specify at least one of the DtsInstanceId and DtsJobId parameters.
DtsJobId String No boss6pn1w******

The ID of the change tracking task. You can call the DescribeDtsJobs operation to query the task ID.

Note You must specify at least one of the DtsInstanceId and DtsJobId parameters.
PageSize Integer No 20

The number of entries to return on each page. Valid values: 1 to 100. Default value: 20.

PageNumber Integer No 1

The number of the page to return. The value must be an integer that is greater than 0 and does not exceed the maximum value of the Integer data type. Default value: 1.

ParentChannelId String No dtsan5114c52******

The parent task ID of the distributed task.

Response parameters

Parameter Type Example Description
HttpStatusCode String 200

The HTTP status code.

RequestId String D66140B3-C747-42B6-8315-BAF6490E****

The ID of the request.

ErrCode String InternalError

The error code returned if the request failed.

PageRecordCount Integer 20

The maximum number of consumer groups that can be displayed on one page.

Success String true

Indicates whether the request was successful.

TotalRecordCount Long 1

The total number of consumer groups.

ErrMessage String The request processing has failed due to some unknown error.

The error message returned if the request failed.

PageNumber Integer 1

The number of the returned page.

ConsumerChannels Array of ConsumerChannel

The details of the consumer groups.

ConsumerGroupUserName String dtstest

The username of the consumer group.

ConsumerGroupId String dtsor2y66j4219****

The ID of the consumer group.

MessageDelay Long 1500

The message latency, which is the timestamp of the latest data consumed by the downstream client minus the timestamp of the latest data tracked by the change tracking task. The value is a UNIX timestamp. Unit: seconds.

For example, the latest data in the source database is generated at 10:00. The change tracking task reads the data generated at 09:55, and the downstream client consumes the data generated at 09:30. In this case, the message latency is the UNIX timestamp difference between 09:55 and 09:30.

Note If the return value of this parameter is -1, no client is connected to the consumer group.
ConsumerGroupName String Consumer Group A

The name of the consumer group.

ConsumptionCheckpoint String 2021-06-20T12:00:00Z

The consumption checkpoint, which is the time when the latest data record was consumed by the change tracking client. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in UTC.

UnconsumedData Long 186600

The total number of unconsumed messages, which is the number of unconsumed data records plus the number of heartbeat messages.

Note If the return value of this parameter is -1, no client is connected to the consumer group.

Examples

Sample requests

http(s)://dts.aliyuncs.com/?Action=DescribeConsumerChannel
&RegionId=cn-hangzhou
&DtsInstanceId=dtsboss6pn1w******

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeConsumerChannelResponse>
    <TotalRecordCount>1</TotalRecordCount>
    <PageRecordCount>20</PageRecordCount>
    <RequestId>D66140B3-C747-42B6-8315-BAF6490E****</RequestId>
    <PageNumber>1</PageNumber>
    <HttpStatusCode>200</HttpStatusCode>
    <ConsumerChannels>
        <ConsumptionCheckpoint/>
        <ConsumerGroupId>dtsor2y66j4219****</ConsumerGroupId>
        <ConsumerGroupUserName>dtstest</ConsumerGroupUserName>
        <ConsumerGroupName>Consumer Group A</ConsumerGroupName>
        <MessageDelay>-1</MessageDelay>
        <UnconsumedData>-1</UnconsumedData>
    </ConsumerChannels>
    <Success>true</Success>
</DescribeConsumerChannelResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalRecordCount" : 1,
  "PageRecordCount" : 20,
  "RequestId" : "D66140B3-C747-42B6-8315-BAF6490E****",
  "PageNumber" : 1,
  "HttpStatusCode" : 200,
  "ConsumerChannels" : [ {
    "ConsumptionCheckpoint" : "",
    "ConsumerGroupId" : "dtsor2y66j4219****",
    "ConsumerGroupUserName" : "dtstest",
    "ConsumerGroupName" : "Consumer Group A",
    "MessageDelay" : -1,
    "UnconsumedData" : -1
  } ],
  "Success" : true
}

Error codes

HTTP status code Error code Error message Description
400 Throttling.User Request was denied due to user flow control. The error message returned because the number of requests exceeds the limit and the request is rejected. Try again later.
500 ServiceUnavailable The request has failed due to a temporary failure of the server. The error message returned because the response of the server timed out or the server was unavailable. Try again. If the error persists, contact technical support.
403 InvalidSecurityToken.Expired Specified SecurityToken is expired. The error message returned because the signature expired. Use a new signature.

For a list of error codes, see Service error codes.