Posted in

Amazon MQ for RabbitMQ 中的 Quorum 队列支持_AI阅读总结 — 包阅AI

包阅导读总结

1. 关键词:Amazon MQ、RabbitMQ、Quorum Queues、High Availability、Data Safety

2. 总结:Amazon MQ 为 RabbitMQ 新增支持 quorum queues,这是一种基于 Raft 共识算法的队列类型,能确保高数据可用性和安全性,适用于特定场景,但有一定使用限制,更多细节可查阅文档。

3. 主要内容:

– Amazon MQ 服务:是用于 Apache ActiveMQ Classic 和 RabbitMQ 的托管消息代理服务,简化设置、操作和管理。

– RabbitMQ 的 Quorum Queues

– 基于 Raft 共识算法,实现耐用、复制的 FIFO 队列。

– 提供复制能力,确保数据高可用性和安全性,节点故障时仍能运行。

– 消息写入磁盘持久化,至少需要三节点集群。

– 特点与使用

– 更安全,失败处理语义更明确。

– 检测网络故障和恢复更快。

– 通过指定参数使用,可更改默认 vhost 队列类型。

– 适用于特定场景,表现更好时队列较短,可设置最大队列长度。

– 与其他消息代理对比:如 Apache Kafka、Apache Pulsar、NATS Streaming 等也使用类似机制增强可靠性。

思维导图:

文章地址:https://www.infoq.com/news/2024/07/quorum-queues-amazon-rabbitmq/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global

文章来源:infoq.com

作者:Steef-Jan Wiggers

发布时间:2024/7/31 0:00

语言:英文

总字数:486字

预计阅读时间:2分钟

评分:86分

标签:消息队列技术,分布式系统,Amazon MQ,RabbitMQ,Quorum 队列


以下为原文内容

本内容来源于用户推荐转载,旨在分享知识与观点,如有侵权请联系删除 联系邮箱 media@ilingban.com

Amazon MQ is a managed message broker service for Apache ActiveMQ Classic and RabbitMQ, simplifying the setup, operation, and management of message brokers on AWS. Recently, AWS announced support for quorum queues, a replicated type designed for higher availability and data safety, for Amazon MQ for RabbitMQ.

The RabbitMQ quorum queue is a modern queue type that implements a durable, replicated FIFO queue based on the Raft consensus algorithm. The Raft Consensus Algorithm is a protocol for managing a replicated log of states across a distributed system to ensure consistency and reliability by electing a leader who coordinates the order and commitment of log entries.

In a LinkedIn post, Saineshwar Bageri, a solutions architect, explains:

Quorum queues provide the replication capability to ensure high data availability and security. They can replicate queue data between RabbitMQ nodes, ensuring that queues can still run when a node breaks down. In Quorum queues, messages are written on the disk for Persistence. You need at least a Three-Node Cluster to Use Quorum queues.

(Source: LinkedIn Post)

In the RabbitMQ documentation, the queues are described as:

Quorum queues are designed to be safer and provide simpler, well-defined failure-handling semantics that users should find easier to reason about when designing and operating their systems.

Furthermore, in an AWS Compute blog post, Vignesh Selvam, a senior product manager at Amazon MQ, and Simon Unge, a senior software development engineer at Amazon MQ, write:

Quorum queues can detect network failures faster and recover quicker than classic mirrored queues, thus improving the resiliency of the message broker as a whole.

Developers can use quorum queues by explicitly specifying the “x-queue-type”parameter as “quorum”on a RabbitMQ broker running version 3.13 and above. The company recommends changing the default vhost queue type to ’quorum’ to ensure all queues are created as quorum queues by default inside a host.

RabbitMQ queues console (Source: AWS Compute blog post)

Quorum queues suit scenarios where data durability and fault tolerance are critical. Yet, they are not meant for temporary use, do not support transient or exclusive queues, and are not recommended for unreplicated queues.

In addition, quorum queues perform better when they are short. Developers can set the maximum queue length using a policy or queue arguments to limit the total memory usage of queues (max-length, max-length-bytes).

Other message brokers use quorum mechanisms to enhance reliability, especially in distributed systems where consistency and fault tolerance are critical. For instance, Apache Kafka, a broker primarily using a log-based approach for message durability, can support quorum-based replication for increased reliability and consistency. Another example is Apache Pulsar, which uses a distributed ledger for message storage managed by BookKeeper, supporting quorum-based replication for data consistency and durability. Lastly, NATS Streaming (now part of NATS JetStream) supports quorum-based replication to ensure message durability and fault tolerance.

More details on the quorum queues in Amazon MQ for Rabbit MQ are available on the documentation pages.