As dead letter exchanges go, is it better to use the default exchange or one per dead letter queue #14239
-
Community Support Policy
RabbitMQ version used4.1.2 Erlang version used27.3.x Operating system (distribution) usedLinux How is RabbitMQ deployed?Community Docker image rabbitmq-diagnostics status outputNot applicable Logs from node 1 (with sensitive values edited out)Not applicable Logs from node 2 (if applicable, with sensitive values edited out)No response Logs from node 3 (if applicable, with sensitive values edited out)No response rabbitmq.confNot applicable Steps to deploy RabbitMQ clusterNot applicable Steps to reproduce the behavior in questionNot applicable advanced.configNo response Application codeNo response Kubernetes deployment fileNo response What problem are you trying to solve?We were wondering what would be the pros and cons of both approaches. For our use case, we could go with using the default exchange as dead letter exchange but we were wondering if that would have any type of performance drawback. On the other hand, if we had a dead letter exchange per dead letter queue, what would be disadvantage? As far as I can tell, and footprint-wise, it would be that we would have more exchanges on mnesia, which would have a minimal impact. Is there anything that I'm missing? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The default exchange is the fastest exchange - there's no need to lookup anything, since the routing key is the name of the destination queue. If that's sufficient for you, it should be the simplest and fastest at the same time. An exchange per queue is just unnecessary. A handful of exchanges should do no harm, but lots of exchanges may for example slow down a node startup. As usual with performance questions, I'd highly recommend running some simple test yourself. You will almost certainly learn some interesting things in the process. |
Beta Was this translation helpful? Give feedback.
The default exchange is the fastest exchange - there's no need to lookup anything, since the routing key is the name of the destination queue. If that's sufficient for you, it should be the simplest and fastest at the same time.
Direct exchanges are very fast in general though, so if your point of reference is a non-default direct exchange, you can see a difference in the benchmarks, but probably not in real life.
An exchange per queue is just unnecessary. A handful of exchanges should do no harm, but lots of exchanges may for example slow down a node startup.
As usual with performance questions, I'd highly recommend running some simple test yourself. You will almost certainly learn some …