Discussion:
[rabbitmq-users] x-consistent-hash - how consistent?
AAuer
2015-03-13 17:11:02 UTC
Permalink
Hello, may I ask a question about the x-consistent-hash exchange:

Is the hashing algorithm used by the exchange consistent across
exchange/queue lifetimes? That is, given the same number of attached queues
and weights, will the same queues always receive the same hash? If this
were the case, I would presume that the order of hash assignment is based
on the order in which the queues were bound - am I correct about that?

In particular, I wish to set up N queues attached to such an exchange;
these queues are durable, fully mirrored and will not be unbound at any
time. Consumers will, depending on the runtime, be responsible for 1 or
more of the N queues.

Now suppose I delete the exchange and queues, and rebuild them (N remains
the same). If routing key "foo" hashed to queue i of N previously, will it
still do so? And is "i" dependent on the order of binding?

Thank you,
Anthony
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AAuer
2015-03-13 19:14:24 UTC
Permalink
Boo to me for not reading the documentation carefully.

"Points in the hash space are randomly distributed"

... basically answers my question, I think. If I am interpreting this
incorrectly, is there anyone who can confirm?
Post by AAuer
Is the hashing algorithm used by the exchange consistent across
exchange/queue lifetimes? That is, given the same number of attached queues
and weights, will the same queues always receive the same hash? If this
were the case, I would presume that the order of hash assignment is based
on the order in which the queues were bound - am I correct about that?
In particular, I wish to set up N queues attached to such an exchange;
these queues are durable, fully mirrored and will not be unbound at any
time. Consumers will, depending on the runtime, be responsible for 1 or
more of the N queues.
Now suppose I delete the exchange and queues, and rebuild them (N remains
the same). If routing key "foo" hashed to queue i of N previously, will it
still do so? And is "i" dependent on the order of binding?
Thank you,
Anthony
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-03-14 07:57:20 UTC
Permalink
Post by AAuer
Boo to me for not reading the documentation carefully.
"Points in the hash space are randomly distributed"
... basically answers my question, I think. If I am interpreting
this incorrectly, is there anyone who can confirm?
See https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange/blob/master/src/rabbit_exchange_type_consistent_hash.erl#L103-123.

The entire exchange is just a few functions  ;)
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...