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.
Notes and Constraints
- When a queue name of a RabbitMQ 3.x.x instance starts with a special character, such as a period (.), the monitoring data may not be displayed. When a queue name contains special characters such as percent (%), vertical bar (|), and slash (/), this name is not consistently displayed on the monitoring page. The special characters are displayed as underscores (_) instead. For example, queue Queue.1%1|2_3/ is displayed as Queue.1_1_2_3_ in monitoring.
- On Cloud Eye, a special character (.) is counted as five characters. If the name of a queue of a RabbitMQ 3.x.x instance contains periods (.) and the counted total length exceeds 256 characters, monitoring data may not be displayed.
Prerequisite
A virtual host has been created.
Creating a RabbitMQ Queue
- Log in to the console.
- Click
in the upper left corner to select the region where your instance is located.
- Click
in the upper left corner and choose Application > Distributed Message Service for RabbitMQ to open the RabbitMQ instance list.
- Click an instance name to go to the instance details page.
- In the navigation pane, choose Instance > 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, periods (.), percent signs (%), vertical bars (|), hyphens (-), underscores (_), or slashes (/).
The name cannot be changed once the queue is created.
Persistence
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.
Lazy Queue
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