[rabbitmq-discuss] New exchange type

Kyle Salasko ksalasko at gmail.com
Tue Apr 22 04:06:53 BST 2008

Hi all,

Recently I put together a new exchange type for RabbitMQ, because none of
the existing ones completely match our requirements. The problem it solves
is this: we want a publish-subscribe model where exactly one subscriber
receives any given message. If we set up a topic exchange and have all
subscribers listen on the same queue, we get this out of the box. But this
requires that all messages go to that one queue, which resides on one
machine, causing a pretty significant bottleneck. A reasonable way around
this was to implement a new exchange type ("anycast") that picks a random
queue when a message is routed. The diff and new file for
rabbit_exchange.erl are attached.

I'm very new to erlang, so feedback/comments/optimizations are extremely


http://www.nabble.com/file/p16820505/rabbit_exchange.erl rabbit_exchange.erl 
View this message in context: http://www.nabble.com/New-exchange-type-tp16820505p16820505.html
Sent from the RabbitMQ mailing list archive at Nabble.com.

More information about the rabbitmq-discuss mailing list