Creating a RabbitMQ Queue
Queues store messages. Each message is sent to one or multiple queues. Producers produce and send messages to queues, and consumers pull messages from queues for consumption.
Multiple consumers can subscribe to one queue. In this case, messages in the queue are distributed to the consumers, and no consumer can have all messages.
This section describes how to create a queue on the console.
Prerequisites
A virtual host has been created.
Creating a RabbitMQ Queue
- Log in to the console.
- In the upper left corner, click and select a region.
Select the region where your RabbitMQ instance is.
- Click and choose Middleware > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
- Click an instance name to go to the instance details page.
- In the navigation pane, choose Virtual Hosts.
- Click a virtual host name.
- On the Queue tab page, click Create Queue. The Create Queue dialog box is displayed.
- Configure the queue name and other parameters by referring to Table 1.
Table 1 Queue parameters Parameter
Description
Name
When creating a queue, you can modify the automatically generated queue name. Naming rules: 3–128 characters and only letters, digits, percent signs (%), vertical bars (|), hyphens (-), underscores (_), slashes (/), or backslashes (\).
The name cannot be changed once the queue is created.
Persistence
This parameter is mandatory for RabbitMQ 3.x.x instances, and enabled by default for RabbitMQ AMQP-0-9-1 instances.
Indicates whether to enable queue persistence.- Enabled: The queue survives after server restart.
- Disabled: The queue will be deleted after server restart and needs to be recreated.
Auto-Delete
Indicates whether to enable automatic queue deletion.
- Yes: The queue will be automatically deleted when the last consumer unsubscribes from the queue.
- No: The queue will not be deleted when the last consumer unsubscribes from the queue.
Dead Letter Exchange
Select an exchange for dead letter messages.
Dead Letter Routing Key
Enter a dead letter message routing key. The dead letter exchange sends dead letter messages to the queue with a binding key that corresponds to this routing key.
Time to Live
Indicates how long messages can remain, in ms. If the time to live passed and messages are still not consumed, they become dead letter messages and are sent to the dead letter exchange.
Highest Priority
Only RabbitMQ AMQP-0-9-1 has this parameter.
Priority of a queue. Range: 1–9. The larger the value, the higher the priority.
Lazy Queue
Only available for RabbitMQ 3.x.x instances.
Enter lazy to make the queue lazy.
Lazy queues store as many messages to the disk as possible. Messages are loaded to the memory only when they are being consumed. This reduces memory consumption.
- Click OK.
View the created queue on the Queue tab page.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot