Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.
- What's New
- Function Overview
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
User Guide
- Process of Using RabbitMQ
- Permissions Management
- Buying a RabbitMQ Instance
- Configuring Virtual Hosts
- Accessing a RabbitMQ Instance
- Managing Messages
- Advanced Features
-
Managing Instances
- Viewing and Modifying Basic Information of a RabbitMQ Instance
- Viewing RabbitMQ Client Connection Addresses
- Managing RabbitMQ Instance Tags
- Resetting the RabbitMQ Instance Password
- Enabling RabbitMQ Plug-ins
- Using the rabbitmq_tracing Plug-in
- Exporting the RabbitMQ Instance List
- Restarting a RabbitMQ Instance
- Deleting a RabbitMQ Instance
- Logging In to RabbitMQ Management UI
- Modifying RabbitMQ Instance Specifications
- Migrating RabbitMQ Services
- Applying for Increasing RabbitMQ Quotas
- Viewing Metrics and Configuring Alarms
- Viewing RabbitMQ Audit Logs
- Best Practices
- Developer Guide
- API Reference
- SDK Reference
-
FAQs
-
Instances
- What RabbitMQ Version Does DMS for RabbitMQ Use?
- What SSL Version Does DMS for RabbitMQ Use?
- Why Can't I View the Subnet and Security Group Information During Instance Creation?
- What If One RabbitMQ VM Fails to Be Restarted When a Cluster RabbitMQ Instance Is Being Restarted?
- How Are Requests Evenly Distributed to Each VM of a Cluster RabbitMQ Instance?
- Do Queues Inside a Cluster RabbitMQ Instance Have Any Redundancy Backup?
- Does DMS for RabbitMQ Support Data Persistence? How Do I Perform Scheduled Data Backups?
- How Do I Obtain the Certificate After SSL Has Been Enabled?
- Can I Change the SSL Setting of a RabbitMQ Instance?
- Can RabbitMQ Instances Be Scaled Up?
- Does RabbitMQ Support Two-Way Authentication?
- Does DMS for RabbitMQ Support CPU and Memory Upgrades?
- How Do I Disable the RabbitMQ Management UI?
- Can I Change the AZ for an Instance?
- How Do I Obtain the Region ID?
- Why Can't I Select Two AZs?
- How to Change Single-node RabbitMQ Instances to Cluster Ones?
- Can I Change the VPC and Subnet After a RabbitMQ Instance Is Created?
-
Connections
- How Do I Configure a Security Group?
- Why Does a Client Fail to Connect to a RabbitMQ Instance?
- Does DMS for RabbitMQ Support Public Access?
- Does DMS for RabbitMQ Support Cross-Region Deployment?
- Do RabbitMQ Instances Support Cross-VPC Access?
- Do RabbitMQ Instances Support Cross-Subnet Access?
- What Should I Do If I Fail to Access a RabbitMQ Instance with SSL Encryption?
- Can I Access a RabbitMQ Instance Using DNAT?
- Why Can't I Open the Management Web UI?
- Can a Client Connect to Multiple Virtual Hosts of a RabbitMQ Instance?
- Why Does a RabbitMQ Cluster Have Only One Connection Address?
- Messages
- Monitoring & Alarm
-
Instances
Configuring RabbitMQ Persistence
By default, messages produced by RabbitMQ producers are stored in the memory. When a node breaks down or restarts, messages are lost. RabbitMQ can persist data during such events for exchanges, queues, and messages.
Persistence means writing messages in the memory to the disk to prevent them from being lost due to exceptions. However, if message persistence is enabled, RabbitMQ performance deteriorates because read and write operations are much slower in disks than in memory. Different from the lazy queue mechanism, a persisted message is stored in both the disk and memory. It is deleted from the memory only when the memory is insufficient.
- Non-persistent queues and exchanges are lost after a restart.
- Non-persistent messages are lost after a restart. (Messages that are sent to persistent queues or exchanges will not automatically become persistent.)
- A message will be lost if the server restarts before the message persistence is complete.
Configuring Exchange Persistence
- On the RabbitMQ management UI
Set durable to true in exchange creation, as shown in Figure 1.
Figure 2 shows a successful configuration.
- On the RabbitMQ console
Configure exchange persistence when creating an exchange, as shown in .
shows a successful configuration.
Configuring Queue Persistence
- On the RabbitMQ management UI
Set durable to true in queue creation, as shown in Figure 3.
Figure 4 shows a successful configuration.
- On the RabbitMQ console
Configure queue persistence when creating a queue, as shown in .
shows a successful configuration.
Configuring Message Persistence
After configuring queue persistence, set MessageProperties to PERSISTENT_TEXT_PLAIN on the client to send persistent messages to the queue.
The following example shows how to configure message persistence on a Java client.
import com.rabbitmq.client.MessageProperties; channel.basicPublish("", "my_queue",MessageProperties.PERSISTENT_TEXT_PLAIN, message.getBytes());
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.