When to declare / bind queues and exchanges using RabbitMQ

We have a wrapper library around RabbitMQ in my workplace, created by someone who no longer works here. I am developing a new system using Rabbit and developing the best approach for queuing, exchanges and bindings. Our Rabbit architecture has several federated global zones, and each zone has several rabbit nodes.

The wrapper code for posting messages and subscribing to queues re-announces the corresponding exchanges, queues, and bindings each time. My concern is that this can lead to a significant delay in each posting of the message, especially if it needs to wait for confirmation that the queue / exchange exists in remote global zones. I expect that the standard of millions of messages per second will not re-announce the exchange for each publication.

In short, this approach seems a little wasteful and paranoid to me, but maybe I am missing something.

So, I have a few questions:

  • Re-announcing queues and exchanging significant success, given global federation?
  • Re-announces that each of them uses a good approach as it handles queues / exchanges that disappear due to a restart of the broker or an explicit deletion?
  • Should we just announce queues and exchanges once per process and expect them to last a lifetime?
  • Should long-term exchanges and queues be declared in the Rabbit configuration and not declared at all by applications?
  • How to change the configuration for queues / exchanges if applications can continue to advertise them with the old configuration? Should applications handle ad rejection and continue publishing / consumption?
+5
source share
1 answer

Reclaims queues and exchanges significant performance result

it can be for a very large volume of messages

Re-announces that each of them uses a good approach because it processes queues / exchanges that disappear due to a restart of the broker or an explicit deletion?

"good approach" - no.

"effective" in preventing exchanges / queues / bindings from disappearing due to problems, yes ... but this is not very good, in most cases

(maybe it's normal if you send a message very rarely, there is a real reason for concern about clearing a clean topology)

Should we just announce queues and exchanges once per process and expect them to last a lifetime?

this is my general approach.

it opens up the possibility of destroying topology, and you do not know this. it all depends on whether you think this will really happen.

Should long-term exchanges and queues be declared in the Rabbit configuration and not be declared by applications?

There is nothing wrong with the predefined topology, but it misses a lot of the power and flexibility of rabbitmq and the amqp protocol.

Many messaging systems require predefined topologies and specialized topology management tools. amqp is completely different in that it allows you to define the topology as needed.

if you are dealing with a static topology then this might be a good option for you.

How to change the configuration for queues / exchanges if applications can continue to advertise them with the old configuration? Should applications simply handle ad rejection and continue to publish / consume?

i will cause the application to crash and report it through any error reporting mechanism that you use.

with a change in topology, usually something important is done for some reason. if the exchange or queue announcement is to change, there is probably a good reason for this and the code should not continue the old announcement.

+7
source

Source: https://habr.com/ru/post/1243183/


All Articles