[Questions] Can a consistent hashing exchange be federated? #14887
-
        Community Support Policy
 RabbitMQ version used4.1.1 Erlang version used27.3.x Operating system (distribution) usedUbuntu 24.04.2 How is RabbitMQ deployed?Kubernetes Operator(s) from Team RabbitMQ rabbitmq-diagnostics status outputSee https://www.rabbitmq.com/docs/cli to learn how to use rabbitmq-diagnostics Logs from node 1 (with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs Logs from node 2 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs Logs from node 3 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs rabbitmq.confSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find rabbitmq.conf file location Steps to deploy RabbitMQ clusterI don't believe deployment steps are relevant to the question I'm asking. Steps to reproduce the behavior in questionSetupUpstream RabbitMQ Server (Server A): 
 Downstream RabbitMQ Server (Server B): 
 Setup Observations
 TestingAfter the Upstream &  Downstream server setup, publish multiple messages to the  Testing Observations
 Questions
 Thanks for your time! advanced.configSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find advanced.config file location Application code# PASTE CODE HERE, BETWEEN BACKTICKSKubernetes deployment file# Relevant parts of K8S deployment that demonstrate how RabbitMQ is deployed
# PASTE YAML HERE, BETWEEN BACKTICKSWhat problem are you trying to solve?Trying to set up a backup/warm standby RabbitMQ server to receive ALL messages that are published to exchanges on the upstream, regardless of exchange type. Federation seems to work for   | 
  
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
| 
         The consistent hashing exchange was never meant to be federated. It is entirely unaware of the state of the ring (or bindings, with the exception of the bindings the plugin manages) on the other side of federation. Exchange federation is not aware of the details of how each exchange type is implemented. It supports the built-in types because they are fairly straightforward (their entire state is a set of bindings). The CHX is a different beast, it has additional state that the set of bindings does not fully express. So when exchange federation binds an internally used queue (it has to use something to collect messages flowing through a federated exchange), that will change the CHX ring for the upstream exchange but nothing will change on the downstream because the downstream does not declare/bind any With an extra internal queue bound to one CHX but not the other, their behaviors will differ because their hash rings are different.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         You are rolling your own "warm standby replication" and I know nothing about its assumption. Not every exchange type can realistically be federated, some are explicitly designed to be cluster-local. Tanzu RabbitMQ has built-in support for warm standby replication, both of the schema and of messages from the queues and streams matched by a policy. If you want to roll your own WSR solution, ask yourself whether the core team would be open to (or allowed to) helping a non-paying, non-contributing user to build an alternative.  | 
  
Beta Was this translation helpful? Give feedback.
The consistent hashing exchange was never meant to be federated. It is entirely unaware of the state of the ring (or bindings, with the exception of the bindings the plugin manages) on the other side of federation.
Exchange federation is not aware of the details of how each exchange type is implemented. It supports the built-in types because they are fairly straightforward (their entire state is a set of bindings). The CHX is a different beast, it has additional state that the set of bindings does not fully express.
So when exchange federation binds an internally used queue (it has to use something to collect messages flowing through a federated exchange), that will change the CHX ring fo…