Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a competing consumer solution?

As a exercise I'm trying to find an example which implements competing consumer.

many producers - > MSMQueue <- competing consumers

So far I did not find any documentation on how to achieve this. My first attempt to figure out how is implemented in MassTransit or NServiceBus failed to many layers of indirection.

Any help will be greatly appreciated.

like image 649
ruslander Avatar asked Jan 31 '12 04:01

ruslander


1 Answers

With MassTransit and MSMQ you can achieve this using the Distributor component.

Note that if you use MassTransit with RabbitMQ instead of MSMQ, you can implement a competing consumer scenario without using the Distributor, simply by setting the same queue name for all consumers. If you can choose between MSMQ and RabbitMQ, I'd go for RabbitMQ, as you get better management tools and SSL encryption, and it plays nicely with firewalls too.

There is some discussion on this over on the MassTransit Google Groups forum.

like image 131
Cocowalla Avatar answered Sep 30 '22 01:09

Cocowalla