Mixing federation and alternate exchanges

28 views
Skip to first unread message

Joshua Gigg

unread,
Dec 2, 2015, 6:58:46 AM12/2/15
to rabbitmq-users
Hi,

I currently have exchanges federated between Rabbit clusters, and I want to try to add Alternate Exchanges into the mix.

The end goal I have is to have a 'catch-all' queue for all messages that don't have bindings in other queues.

What happens is that messages published on the local cluster work fine, and messages published upstream with a routed queue also work.

But any messages that are published upstream, which would fall into the catch-all, do not get sent across the federation. I can see from the upstream's federation queue, that it's not creating the binding for the alternate exchange.

Any ideas on how I can get this to work?

A rough diagram is at: http://i.imgur.com/50LMG9v.png

Michael Klishin

unread,
Dec 2, 2015, 7:01:47 AM12/2/15
to rabbitm...@googlegroups.com, Joshua Gigg
On 2 December 2015 at 14:58:49, Joshua Gigg (gig...@gmail.com) wrote:
> But any messages that are published upstream, which would fall
> into the catch-all, do not get sent across the federation. I can
> see from the upstream's federation queue, that it's not creating
> the binding for the alternate exchange.
>
> Any ideas on how I can get this to work?

Bind it manually. Which, of course, can be quite painful when the queue used by
federation internally is deleted for whatever reason.

You can turn your "catch all" queue to be federated, though. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Joshua Gigg

unread,
Dec 2, 2015, 7:13:34 AM12/2/15
to rabbitmq-users, gig...@gmail.com
On Wednesday, 2 December 2015 12:01:47 UTC, Michael Klishin wrote:
> You can turn your "catch all" queue to be federated, though.  

How do you mean?

The queue is fed from exchanges on both clusters.


Some mixture of a federated queue and an alternate exchange might work.
On the 'B' cluster, the exchange has an alternate exchange, which feeds a queue that is federated to the catch all queue on the 'A' cluster.
Then each defined queue on A will cause a binding on the internal federation queue on B, causing that message not to go down the alternate exchange.

Michael Klishin

unread,
Dec 2, 2015, 7:19:22 AM12/2/15
to rabbitm...@googlegroups.com, Joshua Gigg
On 2 December 2015 at 15:13:36, Joshua Gigg (gig...@gmail.com) wrote:
> On the 'B' cluster, the exchange has an alternate exchange,
> which feeds a queue that is federated to the catch all queue on
> the 'A' cluster.
> Then each defined queue on A will cause a binding on the internal
> federation queue on B, causing that message not to go down the
> alternate exchange.

My thinking was somewhat different but if you need to collect messages across N nodes
into a single logical queue without the need for replication, federated queues
can work very well for that.

Joshua Gigg

unread,
Dec 2, 2015, 8:18:54 AM12/2/15
to rabbitmq-users, gig...@gmail.com
Okay, federated queues didn't seem to work.

I think I have a working solution using two federated exchanges. On the 'B' cluster, it sends unrouted messages to the alternate exchange, which is federated straight to the alternate exchange on the 'A' cluster.


Reply all
Reply to author
Forward
0 new messages