user783836
user783836

Reputation: 3519

Reasons to not use the default exchange on RabbitMQ?

I've started working with RabbitMQ and my use case is quite simple - producers putting messages on queues to to processed by consumers. Each message is processed by at most one consumer and messages are directed from producer to consumer based on queue name.

Direct exchanges seem perfectly fine for this and the default exchange is a direct exchange.

Are there any reasons (performance, management, permissioning etc.) to not use the default exchange and create your own one instead? For example, I will be using high-availability queues (https://www.rabbitmq.com/ha.html) and wasn't sure if there would be any negative impact on the cluster if all the HA queues were on the default exchange as opposed to a different exchange?

Upvotes: 5

Views: 1467

Answers (1)

old_sound
old_sound

Reputation: 2313

With the default exchange you gain performance, since there's almost no routing logic involved, but then you end up coupling your publishers to your consumers, which is kinda an anti-pattern in messaging.

At the same time if your concern is performance, I doubt RabbitMQ's routing performance would be the first problem you encounter. Queue paging, queue synchronization over a network in the case of HA, and so on, seems like things I would worry about when caring for performance.

Upvotes: 1

Related Questions