[rabbitmq-discuss] About RabbitMQ federation plugin

Simone Busoli simone.busoli at gmail.com
Tue Jan 17 07:24:39 GMT 2012


Hi Brian, no you definitely don't need to create any queues manually for
the federation to work. Once you federate an exchange the exchange is
created by the plugin on the downstream server (it has to exist on the
upstream instead) and when you bind a queue to the federated exchange on
the downstream server the bindings are sent to the upstream, which will
deliver just the interesting messages published to the exchange on the
upstream server to the downstream server. In other words it should work
quite intuitively.
On Jan 17, 2012 7:51 AM, "Brian Jing" <brian.newsgroup at gmail.com> wrote:

> Hi guys,
>
> I've played with the federation plugin a little. It seems that in order to
> send a message to a queue on the downstream server, the same queue has to
> be declared on the upstream server for federation to work?
>
> For example:
> __________________
> |                              |
> | Downstream server |   Exchange-D <------  q1
> |_________________|
>              ^
>              |
>              |
> __________________
> |                              |
> | Upstream server     |  Exchange-U <------  q1
> |_________________|
>
> _______
> |            |
> | Client   |
> |_______|
>
> If I want to send messages from client through Upstream server to
> Downstream server, The messages can only get through when I declare a "q1"
> on Upstream server, bind that queue to Exchange-U with a routing key, then
> send the message to Exchange-U using that routing key. Not sure if this is
> how it's supposed to work.
>
> Is it possible not to declare q1 on Upstream server and make federation
> work? My problem is that I have multiple customers listening to their own
> queues on Downstream server, and customers can be removed or added at any
> time. Say if X just connected to Downstream server, and I want to send
> messages to it. How would I be able to send messages to X given that I
> don't have a queue on Upstream server that corresponds to it? Though I
> already know X is in the customer list, when my clients start and
> initialise, I don't think it's a good idea to just create queues for all
> customers on the list, which I think would consume system resources
> unnecessarily.
>
> Hopefully it all makes sense to you guys. Let me know if it's unclear.
>
> The following is my federation config.
> {rabbitmq_federation,
>    [ {exchanges, [[{exchange,     "Exchange-D"},
>                    {virtual_host, "/"},
>                    {type,         "topic"},
>                    {durable,      true},
>                    {auto_delete,  false},
>                    {internal,     false},
>                    {upstream_set, "upsteam-servers"}]
>                  ]},
>      {upstream_sets, [{"upsteam-servers", [[{connection, "192.168.0.21"},
>                                          {exchange,   "Exchange-U"},
>                                          {max_hops,   2}
>                                          ]}
>                      ]},
>      {connections, [{"Upstream-server",       [{host,          "upstream"},
>                                          {protocol,        "amqps"},
>                                          {port,            5671},
>                                          {ssl_options,
>                                           [{cacertfile,
> "/etc/rabbitmq/certs/testca/cacert.pem"},
>                                            {certfile,
> "/etc/rabbitmq/certs/client/cert.pem"},
>                                            {keyfile,
> "/etc/rabbitmq/certs/client/key.pem"},
>                                            {verify,     verify_peer},
>                                            {fail_if_no_peer_cert, false}
>                                           ]}
>                                         ]}
>                                      ]},
>      {local_username, "guest"},
>    ]
>   }
>
> Thanks,
>
> Brian
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120117/45aeb133/attachment.htm>


More information about the rabbitmq-discuss mailing list