Creating a Queue
Function
This API is used to create a queue.
Calling Method
For details, see Calling APIs.
URI
PUT /v2/rabbitmq/{project_id}/instances/{instance_id}/vhosts/{vhost}/queues
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
instance_id |
Yes |
String |
Instance ID. |
vhost |
Yes |
String |
Virtual host name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Queue name. |
auto_delete |
Yes |
Boolean |
Indicates whether to enable automatic deletion. |
durable |
No |
Boolean |
Indicates whether to enable data persistence. |
dead_letter_exchange |
No |
String |
Name of the dead letter exchange. Rejected and expired messages are re-sent to this exchange. |
dead_letter_routing_key |
No |
String |
Routing key of the dead letter exchange. The dead letter exchange sends dead letter messages to the queue with a matching routing key. |
message_ttl |
No |
Long |
Indicates for how long a message in this queue can be retained. |
lazy_mode |
No |
String |
To make this queue lazy, enter lazy. Lazy queues store as many messages as possible on disk to save memory. If this parameter is not set, messages are stored in memory to be delivered quickly. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
name |
String |
Queue name. |
auto_delete |
Boolean |
Indicates whether to enable automatic deletion. |
durable |
Boolean |
Indicates whether to enable data persistence. |
dead_letter_exchange |
String |
Name of the dead letter exchange. Rejected and expired messages are re-sent to this exchange. |
dead_letter_routing_key |
String |
Routing key of the dead letter exchange. The dead letter exchange sends dead letter messages to the queue with a matching routing key. |
message_ttl |
Long |
Indicates for how long a message in this queue can be retained. |
lazy_mode |
String |
To make this queue lazy, enter lazy. Lazy queues store as many messages as possible on disk to save memory. If this parameter is not set, messages are stored in memory to be delivered quickly. |
Example Requests
Creating a queue
PUT https://{endpoint}/v2/rabbitmq/{project_id}/instances/{instance_id}/vhosts/{vhost}/queues
{
"name" : "string",
"auto_delete" : true,
"durable" : true,
"dead_letter_exchange" : "string",
"dead_letter_routing_key" : "string",
"message_ttl" : 6000,
"lazy_mode" : "string"
}
Example Responses
Status code: 200
Successful
{
"name" : "string",
"auto_delete" : true,
"durable" : true,
"dead_letter_exchange" : "string",
"dead_letter_routing_key" : "string",
"message_ttl" : 60000,
"lazy_mode" : "string"
}
Status Codes
Status Code |
Description |
---|---|
200 |
Successful |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.