[rabbitmq-discuss] Custom Exchange Implementation
sustrik at imatix.com
Wed Mar 25 15:42:20 GMT 2009
Whoo. Random distribution of services among the running instances.
Pretty interesting. I've never seen something alike.
Alexis Richardson wrote:
> That's fascinating. Can I ask what application you have that requires this?
> On Wed, Mar 25, 2009 at 3:31 PM, Levi Greenspan
> <greenspan.levi at googlemail.com> wrote:
>> Dear list members,
>> I have hacked together a custom exchange type, which supports bindings
>> without a routing key similar to the fanout exchange type. When a
>> publisher sends a message with routing key R, the message will be send
>> to all queues bound to the exchange with key K=R. If no queue is found,
>> one is randomly selected and a binding from this queue to the exchange
>> with key R is added. Next time a message is send with routing key R, the
>> very same queue will be used.
>> Now, what I have come up with, works reasonably well in testing, however
>> from looking at the code I am afraid the way its done is not safe in the
>> face of parallel calls of rabbit_exchange:route, because I update the
>> shared state (bindings table). Would it be better to create a separate
>> process to handle all this?
>> Maybe someone can give me a little help with this. I should add - what
>> is certainly obvious already - that I am in no way a competent Erlang
>> programmer or that I know much about RabbitMQ's internals. I would just
>> like to get a second opinion about this issue before I run into trouble
>> in production ;-)
>> Many thanks,
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss