Updated on 2023-09-04 GMT+08:00

Viewing a Queue

Function

This API is used to view a specified queue.

URI

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

Table 1 describes the parameters of this API.

Table 1 Parameters

Parameter

Type

Mandatory

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.

Options:

  • true: Include dead letter messages.
  • false: Do not include dead letter messages.

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 Response parameters

Parameter

Type

Description

id

String

Indicates the queue ID.

name

String

Indicates the queue name.

created

String

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.

kafka_topic

String

This parameter is returned only for Kafka queues.

eff_date

String

Indicates the time when a queue is created.

Example response

{
    "id": "0611d466-a327-4b7b-8034-f84a0f6a6f42",
    "name": "queue-001",
    "description": "This is a FIFO queue.",
    "reservation": 4320,
    "created": 1558691803000,
    "queue_mode": "FIFO",
    "max_msg_size_byte": 524288,
    "produced_messages": 14,
    "eff_date": 1558691803000,
    "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.