• Distributed Message Service

dms
  1. Help Center
  2. Distributed Message Service
  3. API Reference
  4. APIs for Managing Queues and Messages
  5. Viewing a Queue

Viewing a Queue

Function

This API is used to view a specified queue.

URI

URI format: GET /v1.0/{project_id}/queues/{queue_id}?include_deadletter={include_deadletter}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Type

Mandatory or Not

Description

project_id

String

Yes

Indicates the ID of a project.

queue_id

String

Yes

Indicates the ID of the queue to be viewed.

include_deadletter

Boolean

No

Indicates whether to list dead letter parameters in the response message. The default value is false.

Kafka queues do not support dead letter messages. This parameter is invalid for Kafka queues.

Example
GET v1.0/b78a90ae2a134b4b8b2ba30acab4e23a/queues/075ae7da-6ce5-4966-940c-17c19fb5175e?include_deadletter=true

Request

Request parameters

None.

Example request

None.

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Parameter description

Parameter

Type

Description

id

String

Indicates the queue ID.

name

String

Indicates the queue name.

created

timestamp

Indicates the time when a queue is created.

description

String

Indicates the basic information about a queue.

queue_mode

String

Indicates the queue type.

reservation

Integer

Indicates the retention period (unit: min) of a message in a queue.

max_msg_size_byte

Integer

Indicates the maximum message size (unit: byte) that is allowed in a queue.

produced_messages

Integer

Indicates the total number of messages in a queue.

redrive_policy

String

Indicates whether to enable dead letter messages. This parameter is displayed only when include_deadletter is set to true.

Options:

  • enable
  • disable

max_consume_count

Integer

This parameter indicates the maximum number of allowed message consumption failures. When a message fails to be consumed after the number of consumption attempts of this message reaches this value, DMS stores this message into the dead letter queue.

This parameter is displayed only when include_deadletter is set to true.

group_count

Integer

Indicates the number of consumption groups in a queue.

kafka_topic

String

This parameter is available only for Kafka queues.

Example response

{
   "id": "9bf46390-38a2-462d-b392-4d5b2d519c55", 
   "name": "queue_001", 
   "description": "test1", 
   "queue_mode" : "NORMAL",
   "created": 1470063965218, 
   "reservation": 4320, 
   "max_msg_size_byte": 524288,
   "produced_messages": 5,
   "group_count": 1        
}

Status Code

Table 3 lists the status code indicating that the operation is successful. For details about the status codes indicating that the operation fails, see Status Code.

Table 3 Status code

Status Code

Description

200

The information is obtained successfully.