Queues and Exchanges RabbitMQ

Can federations or shovels be used to reflect the creation of exchanges and queues on one server to another?

All the examples that I saw when using shovels and federations use exchanges and queues that already exist on the servers. What I want to do is create an exchange on server A and create a federation or a shovel, re-create it on server B, and then start sending messages to it.

If this cannot be done with a federation or a shovel, in any case this can be achieved without using clustering, the connection between the two servers is incompatible, so clustering is not possible.

I am running RabbitMQ for windows.

+7
rabbitmq rabbitmq-exchange
source share
2 answers

You can use the federation plugin.

It supports the exchange of exchange and queue , to mirror queues and exchanges, you can configure policies (using the management console or command line), for example, using these parameters:

Name: my_policy Pattern: ^mirr\. <---- mirror exchanges and queues with prefix "mirr." Definition: federation-upstream-set:all 

you can apply the configuration for exchange and queues, like:

enter image description here

Pattern policy supports regex

Thus, each new or old exchange or queue that begins with the prefix "mirr". will be reflected by another broker.

I think this may solve your problem.

+10
source share

Unfortunately, this cannot be done because the connection is a point-to-point connection. You must associate an exchange with a remote exchange, and in your topology this cannot be created automatically.

I had this problem in the past. And as I decided, the problem was related to business logic. If there was a need for a new Exchange / Queue on the fly, my data entry gateway recognized this and created a new exchange and queues with connections on the local and remote exchanges before the message was sent to RabbitMQ.

+2
source share

All Articles