rabbitmq / rabbitmq-federation

RabbitMQ Federation plugin
https://www.rabbitmq.com/
Other
40 stars 21 forks source link

Cannot federate more that one hop between virtual hosts #116

Closed davidhenery1 closed 4 years ago

davidhenery1 commented 4 years ago

Hi,

I hope you can help with this issue. When using federation between virtual hosts, it is impossible to federate for more than one hop.

We have what looks like the issue reported previously here:-

https://github.com/rabbitmq/rabbitmq-federation/issues/81

We have tested this configuration on rabbit 3.7.5 (Erlang 20.1.7.1, Redhat redhat-release-server-6Server-6.10.0.12.el6.x86_64).

We also tested on rabbit 3.8.2 (Erlang 22.2.1) with the same result.

Here is a picture of the config we are using:-

image

When we publish a message to the X.x exchange a message arrives in the following queues: debug.q on vhost X, debug.q on vhost Y. It does not arrive on Z.q on vhost Z. Max-hops is set to 2.

Here is the exported configuration. Import this configuration and then publish any message to X.x in order to recreate.

XYZ_federation_broker_definitions_V2_json.txt

Many thanks - David Henery.

michaelklishin commented 4 years ago

Routing key used by Federation is a blank string:

        {
            "source": "federation: Y.out.x -> rabbit@rabbit1:Z:Z.in.x B",
            "vhost": "Y",
            "destination": "federation: Y.out.x -> rabbit@rabbit1:Z:Z.in.x",
            "destination_type": "queue",
            "routing_key": "",
            "arguments": {}
        }

I cannot say why that is without spending a few hours debugging. We'll try to understand what's going on but have no ETA to offer. Try using a fanout to compare.

michaelklishin commented 4 years ago

This is due to the fact that exchange federation cycle detector identifies nodes by cluster name. I am working on making it take virtual hosts into account in https://github.com/rabbitmq/rabbitmq-federation/pull/113.