Reputation: 2454
I have 2 RabbitMQ clusters in separate datacenters. At the moment we are shovelling one of the exchanges from an one rabbit to the other but now we need to shovel in the other direction too. How can we achieve this without causing an infinite loop?
A colleague thought we could tick the "Add Forwarding Headers" options and then filter using a Header exchange. However, the headers that get added appear to be nested and I've not found a way to match against the headers?
Upvotes: 4
Views: 2156
Reputation: 2691
Seems based on the additional description you provided that:
I can see two approaches to handle what you're trying to do:
For the shovel option: You have exchange A on cluster 1, exchange A on cluster 2, your main_queue on each cluster
Benefit of Federation: simpler, even when you have complex routing configured
Benefit of shovel: better if you have risk of major connection disruption (more than a minute I'd say). In such cases you won't lose messages while it might happen in the Federation case that some messages don't get replicated on both clusters.
Upvotes: 2