activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tab...@fusesource.com>
Subject Re: AMQ-CMS - questions about threads/producerthreads in AMQ
Date Mon, 07 Mar 2011 13:21:32 GMT
On Mon, 2011-03-07 at 09:28 +0100, mzo@domdv.de wrote:
> Hello Timothy,
> 
> > Creating a Consumer object and registering a MessageListener will result
> > in messages being received in a separate thread, so there's not really
> > any need to create a new thread for your consumer.
> 
> That explains the count of threads upon debugging. I already thought that
> may be the case, but its good to have it confirmed.
> 
> > This is commonly done using a Blocking Queue, the producer thread waits
> > on something being enqueued and once it is, it dequeues it and does
> > whatever work is needed.
> 
> But with a queue there would be a problem that if a subscriber gets
> offline due networking reasons, the messages would stack until a memory
> error occurs, or?
> 
> And with a "Blocking Queue" you mean simply a sync Queue or? Are there
> samples for this?

A sync Q yes.  You look at the MessageDispatchChannel classes in the src
bundle for an idea of how you might implement something that fits your
requirements.  

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/



Mime
View raw message