• Distributed Message Service

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

Viewing All Queues

Function

This API is used to view all queues.

URI

URI format: GET /v1.0/{project_id}/queues?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.

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.

include_messages_num

Boolean

No

true: Return the number of messages in all queues.

false: Do not return the number of messages in all queues.

The default value is false.

Example
GET v1.0/b78a90ae2a134b4b8b2ba30acab4e23a/queues?&include_deadletter=true

Request

Request parameters

None.

Example Request

None.

Response

Response parameters

Table 2 and Table 3 describe the response parameters.

Table 2 Parameter description

Parameter

Type

Description

total

Integer

Indicates the total number of queues that belong to the tenant.

queues

Array

Indicates the total number of all queue arrays that belong to the tenant.

Table 3 queues parameters 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

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.

Example response

{
  "queues" : [{
      "id" : "ef808d2d-58c2-4a36-9e58-d018b2193f80",
      "name" : "aaa_fifo_525",
      "description" : "test_fifo_detail",
      "queue_mode" : "NORMAL",
      "reservation" : 4320,
      "created" : 1495701557000,
      "max_msg_size_byte" : 524288,
      "produced_messages" : 1,
      "redrive_policy" : "enable",
      "max_consume_count" : 3,
      "group_count" : 0
    }, {
      "id" : "bc0ac1ec-a4d6-4490-84cb-9d475f1ec3c5",
      "name" : "aaa_normal_525",
      "description" : "test",
      "queue_mode" : "NORMAL",
      "reservation" : 4320,
      "created" : 1495701490000,
      "max_msg_size_byte" : 524288,
      "produced_messages" : 0,
      "redrive_policy" : "enable",
      "max_consume_count" : 3,
      "group_count" : 0
    }, {
      "id" : "1aaf34d0-7bb0-43be-9b71-f4b719d7ca47",
      "name" : "queue-normal",
      "description" : null,
      "queue_mode" : "NORMAL",
      "reservation" : 4320,
      "created" : 1495447342000,
      "max_msg_size_byte" : 524288,
      "produced_messages" : 2,
      "redrive_policy" : "enable",
      "max_consume_count" : 3,
      "group_count" : 0
    }, {
      "id" : "f685ed59-43f4-4cf9-b609-7f333820d72d",
      "name" : "queue-835807102",
      "description" : "",
      "reservation" : 2160,
      "created" : 1517379348000,
      "queue_mode" : "KAFKA_HA",
      "max_msg_size_byte" : 524288,
      "produced_messages" : 0,
      "group_count" : 0
    }
  ],
  "total" : 4
}

Status Code

Table 4 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 4 Status code

Status Code

Description

200

The information is obtained successfully.