[rabbitmq-discuss] About RabbitMQ federation plugin

Brian Jing brian.newsgroup at gmail.com
Tue Jan 17 06:50:05 GMT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120117/def809e6/attachment.htm>


More information about the rabbitmq-discuss mailing list