Multiple consumers of the same message

2,772 views
Skip to first unread message

andrecarlucci

unread,
Aug 29, 2011, 4:04:53 PM8/29/11
to masstrans...@googlegroups.com
Hello,

First of all, congrats for this great framework. I'm planning to use it extensively on the smart grid area :)

Is it possible to have one message being broadcast to many consumers, where each consumer gets a copy of the same message?
In my scenario I want to broadcast an entity update to all interested systems.

Thanks in advance,

André Carlucci

Dru Sellers

unread,
Aug 29, 2011, 4:15:29 PM8/29/11
to masstrans...@googlegroups.com
Yup. That's bread and butta' :)
-d

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/sCdS2qzGqpEJ.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.

André Carlucci

unread,
Aug 29, 2011, 4:26:30 PM8/29/11
to masstrans...@googlegroups.com
Great :)

So just to be clear: 

Every consumer has it's own queue name: everybody gets the same message.
Consumers sharing queue name: consumer competition.

Is that correct?

Also, do you think the version 2.x is already mature for production? I'm tempted to let thousand of power meters connect to it :)

André
--
André Carlucci
twitter/andrecarlucci

Dru Sellers

unread,
Aug 29, 2011, 4:32:47 PM8/29/11
to masstrans...@googlegroups.com
Every service.exe will have its own queue usually. and each 'consumer' in that 'service.exe' will get its own copy of the message.

Does that make sense?

What's your deploy timeline?

Personally, it is my opinion that you will be much better off on the 2.x line, if for no other reason problems will get fixed faster. The 1.x line you might have to fix yourself. Chris and I are both planning new projects that are going to be moving to the 2.0 line.

-d

Travis Smith

unread,
Aug 29, 2011, 4:33:35 PM8/29/11
to masstrans...@googlegroups.com
Competing consumers aren't really supported with MSMQ. You are welcomed to do that with RabbitMQ though. 

-Travis

Dru Sellers

unread,
Aug 29, 2011, 4:34:39 PM8/29/11
to masstrans...@googlegroups.com
and +1 million for RabbitMQ

André Carlucci

unread,
Aug 29, 2011, 5:02:35 PM8/29/11
to masstrans...@googlegroups.com
I got the idea, thanks.

Initially I don't need competing consumers, but I may in the future for load balancing.

The initial scenario will be two or three different data acquisition systems publishing meter data into the bus, and one consumer getting all the data and putting into an organized central repository.

After that, I'm planning to use the bus to share information between the systems too.

About the queue, I believe it's easier to start with MSMQ because it's available on every windows machine. If you would start a new project, would you pick RabbitMQ since the beginning? Is it easy to change it later?

Thanks,

André

Dru Sellers

unread,
Aug 29, 2011, 5:05:28 PM8/29/11
to masstrans...@googlegroups.com
I would pick rabbitmq for a host of reasons:


MUCH BETTER MGMT TOOLING (as in it exists)
secure (PKI encryption)
fewer ports
speed

its easy for your code, but you would have to think about it differently. we can talk in more depth, but RMQ all the way.

-d

Travis Smith

unread,
Aug 29, 2011, 5:06:50 PM8/29/11
to masstrans...@googlegroups.com
On MSMQ, you have other options for load balancing, I wrote the distributor for that specifically. 

Overall, I think RabbitMQ is much better messaging system than MSMQ. MSMQ hasn't really advanced in a number of years and it really shows when compared to newer MQs. 

-Travis

André Carlucci

unread,
Aug 29, 2011, 5:24:13 PM8/29/11
to masstrans...@googlegroups.com
Nice thoughts, I'll give a deeper look on RabbitMQ.

Tks for the thoughts guys, I really appreciated.

I let you know how the project goes.

Cheers,

André

pasi...@georiot.com

unread,
Aug 28, 2013, 8:55:32 PM8/28/13
to masstrans...@googlegroups.com
Hey guys,


I'm looking at building out a competing consumer implementation, using RabbitMQ.  I have a multiple instances of a single logical service running, where each instance registers just one Consumer instance (which handles just one Message type), and each instance of this service is listening on the same queue (as I understand is possible with RabbitMQ).  

Everything was working just fine in my testing until now, but I just noticed two instances of my service picked up and processed the exact same message (at least once).  They were both sitting idle when the message was queued, and both got it at the same time.  That shouldn't happen, should it?  Any reasons you can think of that might have induced this state?

Thanks,
Jesse

Travis Smith

unread,
Aug 28, 2013, 9:08:28 PM8/28/13
to masstrans...@googlegroups.com
If two consumers are reading off the same queue, they shouldn't be able to consume the same message. The message will go into a 'busy' state until ack'ed. In the busy state, it's effectively gone from other consumers... What version of MT & RabbitMQ are you running? 

-Travis


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

Chris Patterson

unread,
Aug 28, 2013, 10:06:25 PM8/28/13
to masstrans...@googlegroups.com
You might just verify that everything is working properly. We use RabbitMQ and have many servers each running the same service pointing at the same queue without any duplicate deliveries (unless a consumer crashes, and then the message is redelivered to another node).

3.1.3/MT 2.8



pasi...@georiot.com

unread,
Aug 29, 2013, 11:16:54 AM8/29/13
to masstrans...@googlegroups.com
Looks like I accidentally forked the thread, due to some email client issues. (see other email for full description)  But yes, this got me thinking, and it looks like my consumer was actually throwing an exception due to some invalid input, causing the message to be retried several times on each host that was running.  Everything is working fine now. :)

On Wednesday, August 28, 2013 7:06:25 PM UTC-7, Chris Patterson wrote:
You might just verify that everything is working properly. We use RabbitMQ and have many servers each running the same service pointing at the same queue without any duplicate deliveries (unless a consumer crashes, and then the message is redelivered to another node).

3.1.3/MT 2.8

On Wed, Aug 28, 2013 at 5:55 PM, <pasi...@georiot.com> wrote:
Hey guys,


I'm looking at building out a competing consumer implementation, using RabbitMQ.  I have a multiple instances of a single logical service running, where each instance registers just one Consumer instance (which handles just one Message type), and each instance of this service is listening on the same queue (as I understand is possible with RabbitMQ).  

Everything was working just fine in my testing until now, but I just noticed two instances of my service picked up and processed the exact same message (at least once).  They were both sitting idle when the message was queued, and both got it at the same time.  That shouldn't happen, should it?  Any reasons you can think of that might have induced this state?

Thanks,
Jesse


On Monday, August 29, 2011 1:04:53 PM UTC-7, andrecarlucci wrote:
Hello,

First of all, congrats for this great framework. I'm planning to use it extensively on the smart grid area :)

Is it possible to have one message being broadcast to many consumers, where each consumer gets a copy of the same message?
In my scenario I want to broadcast an entity update to all interested systems.

Thanks in advance,

André Carlucci

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.

Faisal Nadeem

unread,
Jan 12, 2015, 2:18:01 AM1/12/15
to masstrans...@googlegroups.com
Thanks @Chris. Actually i have the same structure. I am running two same consumer services on two different machines. One of the consumer is consuming message but when i respond it is throwing the exception. Actually responding context trying to find the publisher endpoint which ins inaccessible. 

Any thoughts?


On Thursday, August 29, 2013 at 5:06:25 AM UTC+3, Chris Patterson wrote:
You might just verify that everything is working properly. We use RabbitMQ and have many servers each running the same service pointing at the same queue without any duplicate deliveries (unless a consumer crashes, and then the message is redelivered to another node).

3.1.3/MT 2.8

On Wed, Aug 28, 2013 at 5:55 PM, <pasi...@georiot.com> wrote:
Hey guys,


I'm looking at building out a competing consumer implementation, using RabbitMQ.  I have a multiple instances of a single logical service running, where each instance registers just one Consumer instance (which handles just one Message type), and each instance of this service is listening on the same queue (as I understand is possible with RabbitMQ).  

Everything was working just fine in my testing until now, but I just noticed two instances of my service picked up and processed the exact same message (at least once).  They were both sitting idle when the message was queued, and both got it at the same time.  That shouldn't happen, should it?  Any reasons you can think of that might have induced this state?

Thanks,
Jesse


On Monday, August 29, 2011 1:04:53 PM UTC-7, andrecarlucci wrote:
Hello,

First of all, congrats for this great framework. I'm planning to use it extensively on the smart grid area :)

Is it possible to have one message being broadcast to many consumers, where each consumer gets a copy of the same message?
In my scenario I want to broadcast an entity update to all interested systems.

Thanks in advance,

André Carlucci

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages