Saturday, April 6, 2019

RabbitMq Federation Support


RabbitMQ  federation


Use Cases for RMQ Federation: 

RMQà Exchanges--à(based on some rules) Queue


I. Multiple cluster of rabbitmq at various geographical location:
Consumer needs to listen to central rabbitmq cluster only. If the consumer starts listening to multiple clusters it would suffer latency problem.
 Federation: Move all the messages from different clusters to central cluster via federation.

 II: distributing load from one queue to multiple clusters. If the consumers are at different locations and there is a one queue where data is being pushed.
Put the same messages over all the clusters.

III. Migrate data from one cluster to second cluster without any downtime

IV. Reduce Latency for message consumption
Consume messages by setting up local cluster where the consumer resides

Type of Federation:
Exchange federation:
It is possible to distribute messages to other cluster . Messages published to federate exchanges will be published to local and downstream  server as well.  Mainly used when the same message you want to consume at multiple places.
 With a federated exchange, queues can be connected to the queue on the upstream(source) node. 

In addition, an exchange on the downstream(destination) node will receive a copy of messages that are published to the upstream node.

Federated exchanges are a similar to exchange-to-exchange bindings, 
in that, they can (optionally) subscribe to a limited set of messages from an upstream exchange.


Queue Federation:
Messages would be distributed over two clusters. Messages here are not duplicated. It is useful to distribute load  or migration of clusters.
 With a federated queue, consumers can be connected to the queue on both the upstream(source) and downstream(destination) nodes.


Upstream server:  where producer is pushing the data.
Downstream servr:  Server where messages need to be forward. From upstream server to the destination.

Pre-requisite:
  1. Two RMQ servers/cluster
  2. Management plugin enabled for dashboard
  3. Connectivity between the two clsute server over amqp protocol on  port 15672

References:
https://www.rabbitmq.com/federation-reference.html
https://www.rabbitmq.com/federated-exchanges.html
https://jasonrowe.com/2018/01/26/rabbitmq-federation-examples/
https://jee-appy.blogspot.com/2018/08/setup-rabbitmq-exchange-federation.html
https://www.youtube.com/watch?v=-ysZPO_3HF0








No comments:

Post a Comment