Queries the consumers who subscribe to a queue.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesListQueueConsumers

The operation that you want to perform.

Set the value to ListQueueConsumers.

InstanceIdStringYes188077086902***

The ID of the instance.

QueueStringYesqueue-rabbit-springboot-advance5

The name of the queue.

RegionIdStringYescn-hangzhou

The ID of the region.

VirtualHostStringYestest

The name of the vhost.

NextTokenStringNocaeba0bbb2be03f84eb48b699f0a****

The token that marks the end position of the previous returned page. Call the operation again by using the value of the NextToken parameter returned by the previous request to obtain the next set of data. Leave this parameter empty the first time you call this operation. If all results have been returned, the value of NextToken in the response parameter is empty.

QueryCountIntegerNo1

The number of data entries to query.

Response parameters

ParameterTypeExampleDescription
DataStruct

The returned data.

ConsumersArray of QueueConsumerVO

An array of consumers.

ConsumerTagStringsgen-1

The consumer tag.

MaxResultsInteger1

The maximum number of returned result entries.

NextTokenStringcaebacccb2be03f84eb48b699f0a****

The token that marks the end of the current returned page. If this parameter is empty, it indicates that you have retrieved all the data.

RequestIdString4409B7D5-E4EC-4EB5-804A-385DCDFCD***

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?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

HTTP status codeError codeError messageDescription
500InternalErrorThe request processing has failed due to some unknown error.The error message returned because an internal error has occurred. Try again later.

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