5

I have an exchange with a vhost, user, etc from that exchange I bind different queues. The exchange and the queues are in the same vhost. Now I want to create a different vhost for a different queue but I cannot bind this new queue from the previous exchange as It is in different vhost.

What is the best solution for that? Thanks

Danilo
  • 199
  • 1
  • 2
  • 12

1 Answers1

7

Your requirement is typically done using the federation or shovel plugins. For your requirement a federated exchange seems the more appropriate.

If I quote your question by naming vhost:

The exchange and the queues are in the same vhost A. Now I want to create a different vhost B for a different queue but I cannot bind this new queue from the previous exchange as It is in different vhost.

  • You create a federated exchange on vhost B
  • This exchange is linked to upstream exchange on vhost A
  • The new queue on vhost B is bound to this federated exchange.
Nicolas Labrot
  • 4,017
  • 25
  • 40
  • Thanks, This was my first option, to create a federation. Just wondering, do we have other options? As for example in my architecture we have already more than 10 federation just for this purpose.. – Danilo Apr 05 '17 at 13:18
  • No as far as I know, vhosts are isolated namespaces. By curiosity, what is your use case? – Nicolas Labrot Apr 05 '17 at 13:22
  • I have Internal rabbit with an exchange. then I have 10 federation each one for a different client and a different queue. I was wondering if It was possible to do in another way rather than all the time to federate. – Danilo Apr 05 '17 at 14:16
  • What is the purpose of having a vhost per client ? (if I understand correctly) – Nicolas Labrot Apr 05 '17 at 14:45
  • so every client cannot see the queue of the others. different vhost/user for each client. Then every client has access to just one exchange and one queue – Danilo Apr 05 '17 at 14:47
  • I conceive permission are not suitable for your use case. Thanks for this answer – Nicolas Labrot Apr 05 '17 at 14:50
  • so what do you think is the best solution? Thank you for all your answers and comments – Danilo Apr 05 '17 at 14:53
  • I will look first at [permissions](https://www.rabbitmq.com/access-control.html), like they control access to queues, a client can have permission to access to only its queues. – Nicolas Labrot Apr 05 '17 at 15:00