Updated on 2024-10-16 GMT+08:00

RabbitMQ Best Practices

This section summarizes best practices of Distributed Message Service (DMS) for RabbitMQ in common scenarios. Each practice is given a description and procedure.

Table 1 RabbitMQ best practices

Best Practice

Description

Automatic Recovery of a RabbitMQ Client from Network Exceptions

This document provides the client reconnection sample code. Clients can be automatically reconnected when network exceptions occur, reducing the impact of network faults on services.

Automatic Consumer Reconnection After a RabbitMQ Node Restart

This document provides the consumer reconnection sample code after a RabbitMQ broker restart. A channel can be created for consumers to continue consumption after the previous channel is closed.

Improving RabbitMQ Performance

This document describes how to achieve high RabbitMQ performance by setting the queue length, cluster load balancing, priority queues, and other parameters.

Configuring Queue Load Balancing

This document describes how to improve cluster utilization by configuring queue load balancing among brokers.

Deduplicating Messages Through Message Idempotence

This document describes the causes of duplicate messages production and the handling measures.

Suggestions on Using DMS for RabbitMQ Securely

This document describes security best practices of using RabbitMQ. It aims to provide a standard guide for overall security capabilities.