Search code examples
rabbitmqvhostsrabbitmq-exchange

Can I bind a queue from a different vhost?


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


Solution

  • 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.