The advantages of DMS RabbitMQ include the following aspects:
High Availability
DMS RabbitMQ ensures the continuity and reliability of service using the following methods:
Ø Automatic load balancing of production and consumption
l Multiple consumers: RabbitMQ allows you to create multiple consumers to simultaneously consume messages in the same queue. RabbitMQ distributes messages evenly among these consumers for load balancing.
l Publish/subscribe mode: supports automatic load balancing. In this mode, the producer sends a message to the exchange, which broadcasts the message to all queues bound to it. Each queue has multiple consumers to share the messages they have received.
l Priority queue: RabbitMQ supports priority queues, which are sorted and transmitted based on the priority of messages. In a priority queue, high-priority messages are processed faster, thus achieving load balancing.
Ø Automatic master/slave switchover upon a node failure
l Configure mirror queues: First, you need to configure mirror queues between nodes in a RabbitMQ cluster. A mirror queue copies messages to the slave node, which takes over services if the master node fails.
l Heartbeat detection: RabbitMQ monitors the status of the connections between nodes using the heartbeat mechanism. If the master node fails during communication, such as a network failure or a node crash, the slave node is elected as the new master node.
l Node election: If the master node fails during communication, other nodes in the RabbitMQ cluster will elect a slave node to work as the master node. During the election, the nodes communicate with each other about states and capabilities. Eventually, a master node will be elected as the new master node.
l Automatic switchover: Once the new master node is elected, the RabbitMQ cluster will automatically switch to the new master node to process messages. The client reconnects to the new master node via the same connection and continues to send and receive messages.
Ø Mirror queue security backup
l Data replication: The mirror queues in RabbitMQ provide redundant backup by copying queue messages across multiple nodes. Each node maintains a complete queue copy. When one node fails, other nodes take over the work to process messages continuously.
l Synchronous replication: The mirror queue supports synchronous and asynchronous replication. In synchronous replication mode, write operations wait for all mirror nodes to complete their operations to ensure data consistency. However, this increases the latency of write operations.
l Fault tolerance: When a node fails, RabbitMQ will automatically reallocate queues on the faulty node to other working nodes. It is an automatic process that requires no human intervention. Messages will not be lost even if the entire node fails.
l High availability (HA): The mirror queues guarantee HA. If a node fails, the other nodes automatically take over the queue on the faulty node to process messages. This ensures the reliability and availability of the system.
l Fault recovery: When a node is restarted after a failure, RabbitMQ will automatically synchronize the queues on the node to the new mirror node, ensuring data integrity and consistency.
High Security
It originates from the financial system, with support for permission control and SSL protocol to realize high security.
Ø Permission control
l User: Used to identify a client that is connected to RabbitMQ. Each user is assigned a username and password.
l Vhost: A virtual host is a logical isolation unit in RabbitMQ that separates different applications or services. Each Vhost has a name and can be configured with different permissions.
l Permission: Defines the operation permissions on RabbitMQ resources, such as exchanges, queues, and bindings. The permissions include read, write, publish, and receive.
l Role: Refers to a set of permissions. You can assign roles to users to streamline permission management.
Ø SSL protocol
l SSL protocol: Secure Sockets Layer (SSL) is a protocol that secures the transmission of data to secure network communications through the encryption technology.
l SSL protocol supported by RabbitMQ: You can configure RabbitMQ with the SSL protocol to protect data transmission. You can also use self-signed certificates or certificates signed by a trusted certificate authority (CA).
l SSL certificate configuration: To enable the SSL protocol in RabbitMQ, you need to generate SSL certificates for both the server and the client. You can use OpenSSL to generate a self-signed certificate or request a certificate signed by a trusted CA.
l RabbitMQ server configuration: Specify SSL-related parameters, such as the certificate path, private key path, and password, in the configuration file on the RabbitMQ server. You can also configure whether to validate the certificate on the client and whether to enable the TLS version.
l Client configuration: Specify SSL-related parameters, such as the certificate path, private key path, and password, in the client before connecting to the RabbitMQ server. You can also configure whether to validate the server's certificate on the client.
l Client connection: After you have configured SSL-related parameters for both the RabbitMQ server and the client, the client uses SSL to connect to the RabbitMQ server. The client establishes an SSL connection through the specific SSL option.
l Encrypted data transmission: The connection established through the SSL protocol secures data transmission. All data sent and received over SSL connections are encrypted and decrypted using encryption algorithms to avoid man-in-the-middle attacks and data leaks.
High Reliability
DMS RabbitMQ uses the persistence, Transport Confirm, and Publish Confirm mechanisms to ensure reliability.
Ø Persistence
l Message persistence: By default, RabbitMQ stores messages in memory. If the RabbitMQ server shuts down or fails, unconsumed messages will be lost. To solve this problem, you can set persistent for messages. When a message is marked persistent, RabbitMQ stores the message in a file on the disk. This way, the message is available after the server is restarted.
l Queue persistence: You can also mark queues as persistent. When a queue is marked persistent, RabbitMQ stores the metadata and messages of the queue to a file on the disk. This way, the queue and its messages will be re-created after the server is restarted.
l Exchange persistence: You can also mark exchanges as persistent. When an exchange is marked persistent, RabbitMQ stores the metadata of the exchange to a file on the disk. However, an exchange does not store messages. If the exchange is persistent but is not bound with persistent queues, unconsumed messages will be lost.
l Persistence mode: In RabbitMQ, you can mark both messages and queues or either of them as persistent. You can mark both the message and the queue as persistent to ensure the security of messages to the greatest extent possible. However, persistence of all messages may degrade performance.
Ø Transport confirm
l Publish Confirm: Ensures that a message sent from the producer is received and processed by RabbitMQ. It can be achieved by the transaction or confirm mode.
l Transaction mode: In this mode, producers send a message to RabbitMQ and commit a transaction. If a message is sent successfully, the transaction is committed and the message is received and processed by RabbitMQ. Otherwise, the transaction is rolled back.
l Confirm mode: In this mode, the producer sends a message to RabbitMQ and waits for an ack from RabbitMQ, indicating that the message has been received and processed successfully.
l Batch confirm of multiple messages: You can batch ack messages.
l Asynchronous confirm: In this mode, the ack results are processed using a callback function, without the need to wait for the ack after a message is sent.
l Ack timeout: To avoid blocking resulting from failures to send messages or no response in a long time, you can set the ack timeout period. If no ack message is received within the specified period, the message fails to be sent.
Ø Publish confirm
The Publish Confirm mechanism of RabbitMQ ensures that messages are successfully received after being sent to the queue. It provides two publish confirm modes, namely, simple confirm and batch confirm.
l Simple confirm:
After a message is sent, the producer waits for an ack from RabbitMQ.
After receiving and storing the message in the queue, RabbitMQ returns an ack to the producer.
If a message is not successfully sent to the queue, RabbitMQ will return a reject reply to the producer.
Producers can handle the ack and reject replies based on the specific circumstances.
l Batch confirm:
After sending a batch of messages, the producer waits for an ack from RabbitMQ.
After receiving and storing these messages in the queue, RabbitMQ returns an ack to the producer.
If any message is not successfully sent to the queue, RabbitMQ will return a reject reply to the producer and will not store the entire batch of messages.
Producers can handle the ack and reject replies based on the specific circumstances.
Out-of-the-Box
DMS RocketMQ supports one-click deployment and out-of-the-box and O&M-free service to help you quickly migrate your business to the cloud.