Queries the consumers that subscribe to a specified queue.

Request parameters

Parameter Type Required Example Description
Action String Yes ListQueueConsumers

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

ListQueueConsumers.

InstanceId String Yes 188077086902***

The ID of the instance.

Queue String Yes queue-rabbit-springboot-advance5

The name of the queue.

RegionId String Yes cn-hangzhou

The ID of the region.

VirtualHost String Yes test

The name of the virtual host (vhost).

NextToken String No caeba0bbb2be03f84eb48b699f0a****

The token that marks the end position of the result to return. To obtain the next batch of data, call the operation again by using the value of the NextToken parameter returned by the previous request. The first time you call this operation, set the NextToken parameter to an empty string. If you want to query all results, set the NextToken parameter to an empty string.

QueryCount Integer No 1

The number of data entries to return. If you do not specify the value of the QueryCount parameter, the default value 1 is used.

The value of this parameter is not limited. We recommend that you set this parameter to an integer that ranges from 1 to 100.

Response parameters

Parameter Type Example Description
Data Struct

The returned data.

Consumers Array of QueueConsumerVO

An array of consumers.

ConsumerTag String sgen-1

The consumer tag.

MaxResults Integer 1

The maximum number of returned result entries.

NextToken String caebacccb2be03f84eb48b699f0a****

The token that marks the end position of the returned result. If this parameter is empty, all data is returned.

RequestId String 4409B7D5-E4EC-4EB5-804A-385DCDFCD***

The ID of the request.

Examples

Sample requests

http(s)://amqp-open.cn-hangzhou.aliyuncs.com/?Action=ListQueueConsumers
&InstanceId=188077086902***
&Queue=queue-rabbit-springboot-advance5
&RegionId=cn-hangzhou
&VirtualHost=test
&<Common request parameters>

Sample success responses

XML format

<ListQueueConsumersResponse>
      <RequestId>4409B7D5-E4EC-4EB5-804A-385DCDFCD***</RequestId>
      <Data>
            <NextToken>AAAATzkBMTg4MDc3MDg2OTAyMzQyMAF0ZXN0AXF1ZXVlLXJhYmJpdC1zcHJpbmdib290LWFkdmFuY2U1ATc3NjMxNjIwATE1OTEzNTA5MDkzMDkBrWuX5aAiG4ytL5ffWi0HBUjdleo=</NextToken>
            <MaxResults>1</MaxResults>
            <Consumers>
                  <ConsumerTag>sgen-1</ConsumerTag>
            </Consumers>
      </Data>
</ListQueueConsumersResponse>

JSON format

{
    "RequestId": "4409B7D5-E4EC-4EB5-804A-385DCDFCD***",
    "Data": {
        "NextToken": "AAAATzkBMTg4MDc3MDg2OTAyMzQyMAF0ZXN0AXF1ZXVlLXJhYmJpdC1zcHJpbmdib290LWFkdmFuY2U1ATc3NjMxNjIwATE1OTEzNTA5MDkzMDkBrWuX5aAiG4ytL5ffWi0HBUjdleo=",
        "MaxResults": 1,
        "Consumers": {
            "ConsumerTag": "sgen-1"
        }
    }
}

Error codes

HttpCode Error code Error message Description
500 InternalError The request processing has failed due to some unknown error. The error message returned because the request fails to be processed due to an unknown error.

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