RabbitMQ Common Mistakes: Chapter Two

RabbitMQ Common Mistakes: Chapter Two

As a RabbitMQ user, consultant, and now a member of the RabbitMQ team, I've noticed recurring mistakes that many users still make. In this series of posts, I will highlight these mistakes and offer practical solutions to help you avoid them. By the end of this series, you'll learn how to optimize your usage of RabbitMQ and enhance your system's efficiency.


Chapter Two: Use Classic Queues for Everything

"Classic queues" (CQ) were the first type of queue introduced in RabbitMQ and have been used for many years. We all appreciate classic queues ??, but there are other queue types:

It's surprising how many users rely only on Classic Queues for everything!

Here are some reasons why:

  • Many client libraries default to using classic queues.
  • Many users are unaware that other queue types exist.

Just so you know:

  • Starting from version 4.0, RabbitMQ no longer supports mirroring for classic queues.
  • Quorum Queues are replicated by default. (You should use these)

Should I stop using classic queues?

No, absolutely not! The RabbitMQ team continues to support classic queues, which are suitable for specific use cases that other queue types cannot address.

What should you do?

Use the appropriate queue type for the proper context. It sounds simple, right? In most instances, Quorum queues (QQ) can effectively replace classic queues. You can change the default queue type in your virtual host options in this way clients will define QQ as default. See:



Here's a summary of when to use the different queue types:

- Quorum Queues (QQ): Use when you require data replication and the AMQP behavior.

- Classic Queues (CQ): Use for scenarios like exclusive queues and/or when replication is unnecessary.

- Stream Queues (SQ): Unlike CQ and QQ, which are FIFO (First In, First Out) queues, messages are removed once consumed and acknowledged. Stream queues operate as an append-only system. They can store millions of messages, messages replay, have high throughput and enable large-scale fanout.

Conclusions

This post encourages you to explore the different types of queues available in RabbitMQ rather than forcing a single solution.

For more information, check out:



Happy RabbitMQ messaging! ??

Alessandro Minoccheri

Engineering Manager @InPost

2 周

This is really interesting, I need to identify the right way to make a decision to use a classic queue or not. I need to go deeper into this topic!

Roberto Bertuccio

Senior Software Developer @ XTEL

2 周

Short, direct on point and very self-explanatory newsletter. Well done. In addition would be great to have real scenario examples of adoption?

Jody Donetti

R&D + coding | ?? FusionCache | Google OSS Award | Microsoft MVP Award

2 周

Not a RMQ expert, but versions/dates when quorum and stream queues have been introduced seem odd, 3.8 release after 3.9? Maybe a typo?

要查看或添加评论,请登录

Gabriele Santomaggio的更多文章

  • RabbitMQ Common Mistakes: Chapter Four

    RabbitMQ Common Mistakes: Chapter Four

    As a RabbitMQ user, consultant, and now a member of the RabbitMQ team, I've noticed recurring mistakes that many users…

    2 条评论
  • RabbitMQ Common Mistakes: Chapter Three

    RabbitMQ Common Mistakes: Chapter Three

    As a RabbitMQ user, consultant, and now a member of the RabbitMQ team, I've noticed recurring mistakes that many users…

    2 条评论
  • RabbitMQ Common Mistakes: Chapter One

    RabbitMQ Common Mistakes: Chapter One

    During these years as a RabbitMQ user, consultant, and RabbitMQ team member (now), I have seen and still see the same…

    3 条评论
  • Let's use #RabbitMQ stream queues to backup the messages.

    Let's use #RabbitMQ stream queues to backup the messages.

    Let's talk about introducing RabbitMQ stream queues in a way that won’t disrupt your existing setup! Imagine using…

    9 条评论

社区洞察

其他会员也浏览了