[rabbitmq-discuss] Federating messages in upstream with specific routing key

Simon MacMullen simon at rabbitmq.com
Wed Jun 4 11:40:57 BST 2014


On 04/06/14 00:43, vish.ramachandran wrote:
> I am in reference to this FAQ at
> https://www.rabbitmq.com/federated-exchanges.html
>
> ==========
> Are all messages copied?
> Only those messages that need to be copied are propagated. This is an
> optimisation arranged dynamically by the federation plugin. (See below.)
>
> ==========
>
> My situation requires me to federate from an upstream exchange only messages
> with a specific routing key. The above FAQ seems to indicate this is
> possible. However, I didn't find any option that allows me to specify a
> routing key while configuring upstream queue.
>
> Is this possible ?

It's automatic; there's nothing special to configure.

Federation will add a binding upstream when you add a binding 
downstream, and keep the bindings in sync. So only messages that will be 
delivered downstream get transmitted over the link.

Or are you saying you explicitly want to prevent messages from being 
federated, even if someone binds downstream saying they want them? In 
that case, you would need to do something like:

1) Declare two exchanges, A and B upstream. Ensure you publish to A.
2) Bind A (source) and B (destination) with the routing key you want to 
use to limit federated messages.
3) Set B as the upstream exchange for the federated exchange downstream.

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list