federated queue links to other of its federated peers (called upstream queues). It will retrieve messages from upstream queues in order to satisfy demand for messages from local consumers.

Federated queues distribute queue contents to federated nodes that have consumer but do not replicate.

Requirement

  • Know which one is you Upstream Server and DownStream Server
  • Enable :- rabbitmq-plugins enable rabbitmq_federation “On DownStream Server “
  • Must Have same Queue Name and binding on Both Server.
  • Upstream Server Where Message are orginally Published.
  • Downstream Server where the messages get forwarded to.

First are going to Enabling rabbitmq_federation Plugin on Downstream Server.

After enabling we are going to see this Options on Server.

Clicking on Federation Upstreams to configure it.

Here we are going to Enter Upstreams Server Details and Configure it.

Enter Name :- federation-policy
URI :- amqp://admin:guest@191.188.200.202:5672/

Example :- [amqp://Username : Password @ IPAddress : PORT ]

After Adding a new upstream.

Now to Check Status

Now we have configure Federation Queue. Next adding Policy.

Adding Policy

Add Name :- federation-policy
Pattern :- .federation_. “This pattern should match with Queue Name.”
Federation :- federation-upstream-set : all

After Adding now when we push message to Upstream server then we are going to receive message on downstream server.

We can consume message on both upstream and downstream server also.

Upstream server

Message will be uploaded to upstream first then it is moved downstream server.

Downstream server

By Saineshwar

Microsoft MVP for Developer Technologies | C# Corner MVP | Code project MVP | Senior Technical Lead | Author | Speaker | Love .Net | Full Stack developer | Open source contributor.