2

We have a RabbitMQ cluster with three nodes configured. Each node has two virtual hosts (Vhost-A and Vhost-B). We need a possibility to move messages from Vhost-A to Vhost-B. To accomplish this, we setup a shovel directing messages from Exchange-1 on Vhost-A to Exchange-2 on Vhost-B.

rabbitmqctl -p Vhost-A set_parameter shovel shovel-exchange-1-to-vhost-b /
  '{"src-uri": "amqp://user@/Vhost-A", "src-exchange": "Exchange-1", /
    "src-exchange-key": "#", "dest-uri": "amqp://user@/Vhost-B", /
    "dest-exchange": "Exchange-2", "add-forward-headers": false, /
    "ack-mode": "on-confirm", "delete-after": "never"}'

This has the side-effect of replicating the messages on the destination Exchange-2. Meaning, the test-queue we bound to Exchange-2 on Vhost-B receives the same message three times (once from each cluster node).

How can we prevent this? Does it require a change in the shovel configuration or in the cluster configuration?

RabbitMQ version: 3.6.15

UPDATE 1:

We have two exclusive queues that cannot be deleted, because they are locked. Those queues disappear, once we disable shovel plugin on all cluster nodes. As soon as we reactivate the plugin on one node, the queues are created again.

froeschli
  • 2,692
  • 2
  • 28
  • 55
  • Hi @froeschli, from your description, it sounds like you configured 3 shovels, while having a cluster setup. Can you confirm this interpretation of your setup? – Olivier Feb 05 '19 at 10:44
  • I issued the configuration command on one node and the other two mirrored that shovel. I noticed that I have three queues on every node with the same binding, that were created automatically. – froeschli Feb 05 '19 at 12:48

1 Answers1

0

It seems to have been a configuration error. I tested the shovel plugin manually and I must have added shovel configurations to the root ('/') virtual host. For some reason, these did not show up in the management console. Using

rabbitmqctl list_parameters

I saw two additional shovel configurations on the root virtual host. After dropping those shovels, the according queues were removed as well. Adding the shovel as described in the question added the shovel and created one queue. Since then, the message is only forwarded once.

Thank you @Olivier for hinting at multiple shovels. That comment brought me on the right track.

froeschli
  • 2,692
  • 2
  • 28
  • 55