Fanout to queues in different virtual hosts?

1,563 views
Skip to first unread message

James McMahon

unread,
Aug 8, 2017, 6:16:00 AM8/8/17
to rabbitm...@googlegroups.com
Our existing rmq architecture defines virtual hosts Prod, Dev, Int, and Demo. Inside each of those virtual hosts is an exchange, all four named the same: the-exchange.

These exchanges are durable Topic exchanges. I submit a message to Virtual Host Demo, with exchange the-exchange, with routing key appA.eval, which results in a message in Queue appA-evaluation.

I have a new requirement from a customer for a fanout of a posted message across Virtual Host boundaries. The incoming message must post to Prod, Dev, Int, and Demo vhosts. I've done some preliminary research and suspect I want to employ a federated exchange, but the discussions are not clear how the Virtual Hosts play into the configuration.

How can this be done? Thanks in advance for your guidance.

Michael Klishin

unread,
Aug 8, 2017, 8:44:13 AM8/8/17
to rabbitm...@googlegroups.com
By opening a connection to each vhost and publishing a copy. Virtual hosts
do not share any entities by design: http://www.rabbitmq.com/vhosts.html.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

V Z

unread,
Aug 15, 2017, 7:01:07 PM8/15/17
to rabbitmq-users
You can use exchange federation to have messages published to an exchange in one virtual host to also get published to an exchange in another virtual host. This is no different from when exchanges are on different clusters. Although virtual hosts in that case are named the same, they are still physically different virtual hosts. 

Usually, when federating across clusters you have:

In cluster A, vhost X:
  upstream: cluster B, vhost X (e.g. amqp://cluster-b.you.com/X)

In your case, the first virtual host needs to be set up as the upstream for the second virtual host:

In cluster A, vhost X:
  upstream: cluster A, vhost Y (e.g. amqp://cluster-a.you.com/Y)


Reply all
Reply to author
Forward
0 new messages