tencent cloud

TDMQ for RabbitMQ

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Introduction and Selection of the TDMQ Product Series
What Is TDMQ for RabbitMQ
Strengths
Use Cases
Description of Differences Between Managed Edition and Serverless Edition
Open-Source Version Support Description
Comparison with Open-Source RabbitMQ
High Availability
Use Limits
TDMQ for RabbitMQ-Related Concepts
Regions
Related Cloud Services
Billing
Billing Overview
Pricing
Billing Example
Convert to Monthly Subscription from Hourly Postpaid
Renewal
Viewing Consumption Details
Overdue Payments
Refund
Getting Started
Getting Started Guide
Step 1: Preparations
Step 2: Creating a RabbitMQ Cluster
Step 3: Configuring a Vhost
Step 4: Using the SDK to Send and Receive Messages
Step 5: Querying a Message
Step 6: Deleting Resources
User Guide
Usage Process Guide
Configuring the Account Permission
Creating a Cluster
Configuring a Vhost
Connecting to the Cluster
Managing Messages
Configure Advanced Feature
Managing the Cluster
Viewing Monitoring Data and Configuring Alarm Policy
Use Cases
Use Instructions of Use Cases
RabbitMQ Client Use Cases
RabbitMQ Message Reliability Use Cases
Usage Instructions for MQTT Protocol Supported by RabbitMQ
Migrate Cluster
Migrating RabbitMQ to Cloud
Step 1. Purchasing a TDMQ Instance
Step 2: Migrating Metadata to the Cloud
Step 3: Enabling Dual Read-Write
API Reference (Managed Edition)
API Overview
API Reference (Serverless Edition)
History
Introduction
API Category
Making API Requests
Relevant APIs for RabbitMQ Serverless PAAS Capacity
RabbitMQ Serverless Instance Management APIs
Data Types
Error Codes
SDK Documentation
SDK Overview
Spring Boot Starter Integration
Spring Cloud Stream Integration
Java SDK
Go SDK
Python SDK
PHP SDK
Security and Compliance
Permission Management
Network Security
Deletion Protection
Change Records
CloudAudit
FAQs
Service Level Agreement
Contact Us

Configure RabbitMQ Persistence

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-01-04 15:02:28
RabbitMQ stores messages in memory by default. Once a node crashes or restarts, these messages are lost.
To prevent this situation, RabbitMQ provides a persistence feature that saves messages to the disk, ensuring that messages are not lost even if the server encounters issues. Persistence includes exchange persistence, queue persistence, and message persistence.
After message persistence is enabled, messages are stored in both memory and the disk. Only when memory is insufficient will RabbitMQ remove certain messages from memory and retain them solely on the disk. Note that persistence reduces RabbitMQ performance because the read-write speed of the disk is much slower than that of memory. In comparison, lazy queues write messages directly to the disk, instead of storing them in both memory and the disk.

Constraints and Limitations

Non-persistent queues and exchanges will be lost after a service restart and need to be recreated.
Messages not marked as persistent will be lost after a service outage. Even messages declared as persistent may still be lost if a service interruption occurs during the disk write process. Only messages successfully persisted to the disk can be recovered after a restart.
Only Managed Edition clusters require configuring persistence. Serverless Edition clusters have persistence enabled by default and do not require configuring persistence.

Configuring Exchange Persistence

When creating an exchange, enable Durable in the parameter settings. For specific steps, see Creating an Exchange.


Configuring Queue Persistence

When creating a queue, enable Durable in Basic Information. For specific steps, see Creating a Queue.


Configuring Message Persistence

After a queue is set as persistent, persistent messages can be sent to it from the client.
Below is a Java client example, implemented by setting the MessageProperties parameter to PERSISTENT_TEXT_PLAIN.
import com.rabbitmq.client.MessageProperties;
channel.basicPublish("", "test_queue",MessageProperties.PERSISTENT_TEXT_PLAIN, message.getBytes());


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan