[rabbitmq-discuss] message routing by consistent hash?

Alvaro Videla videlalvaro at gmail.com
Tue Apr 26 19:36:42 BST 2011


Hi Jon,

I think this could be pretty cool for distributing messages over a cluster. So:

Queue content is not replicated in a cluster but AFAIK the Exchange information and the bindings are. So you could have *node_a* and *node_b* both with *exchange_a* declared on them. Then you could declare *queue_a*  in *node_a* and *queue_b* in *node_b* and bound them to the *exchange_a* using the same routing key.

If you publish messages to the *exchange_a* then it will chose to route the message to either of those queues. In case of one node going down and if the exchange somehow notices that the binding to the queue that is gone disappeared then the messages won't get lost because they will be routed to the other node. Of course this is not replication, but I think it could be somehow useful. For example messages won't get duplicated and delivered twice, issue that could happen with a broken replication.

Cheers,

Alvaro

Twitter: @old_sound
On Apr 26, 2011, at 8:29 PM, Alexis Richardson wrote:

> Folks have used hashing to distribute keys with the direct exchange in
> the past.  Under certain assumptions, this can work quite well.  For
> example: usernames for social network activity streams.
> 
> 
> On Tue, Apr 26, 2011 at 7:26 PM, Jon Brisbin <jon at jbrisbin.com> wrote:
>> I'm chewing on a scalability problem and trying to use consistent hashing to solve it. Would it be possible to implement message routing based on a consistent hash of the routing key in a way similar to how Riak and riak_core uses it to distribute data/work?
>> 
>> It would basically be an extension of the random direct exchange I just put on my GitHub but instead of using a uniform random function, it would use a consistent hash.
>> 
>> Thanks!
>> 
>> Jon Brisbin
>> 
>> http://jbrisbin.com
>> Twitter: @j_brisbin
>> 
>> 
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Sent form my Nokia 1100





More information about the rabbitmq-discuss mailing list