Consistent hashing Exchange #4116
-
Hi I'm using Consistent hashing Exchange to scale up with respect of messages ordering. Will Consistent hashing algorithm be reset when a new broker is added or removed from the cluster or when the broker goes down "crash" ? Will i lose the order of messages in the above cases ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@michaelklishin can you advise please ? |
Beta Was this translation helpful? Give feedback.
-
@melfeqy please, be patient. It is the weekend. In addition, there is no need to directly mention a RabbitMQ core team member. We all are notified when someone asks a question. Also, your question is answered here Finally, you can test it out yourself! |
Beta Was this translation helpful? Give feedback.
-
@melfeqy this is not a place where you demand free support on a Sunday from a core team member. This is a place where you ask a question and hope — and then appreciate — that your question gets a response. No one here owes you anything. This community help also costs you nothing, even when it comes from a core team member. |
Beta Was this translation helpful? Give feedback.
-
Addition of new nodes has no effect on the state of the consistent hashing exchange ring. The ring is formed by the queues bound to a given consistent hashing exchange. So any ring changes happen when a queue is bound to or unbound from a consistent hashing exchange. The state of the ring is rebuilt on node restart using all durable bindings (bindings between a durable exchange and a durable queue), so it should cover all durable queues. However, as plugin README explains, the position of those same queues on the ring can be different, and thus routing key distribution between them is not guaranteed to be identical after a restart. |
Beta Was this translation helpful? Give feedback.
@melfeqy please, be patient. It is the weekend. In addition, there is no need to directly mention a RabbitMQ core team member. We all are notified when someone asks a question.
Also, your question is answered here
https://github.com/rabbitmq/rabbitmq-server/tree/master/deps/rabbitmq_consistent_hash_exchange#node-restart-effects
Finally, you can test it out yourself!