activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Fernandez <>
Subject Re: Is it possible to have 1 MessageListener POJO handle multiple queues?
Date Thu, 04 Feb 2010 17:19:32 GMT

Can you have two instances of the same POJO? If so, create two separate
threads with their own sessions to the appropriate destination and give each
thread an instance of the POJO. 

What about spawning multiple threads, each having their own Session,
instance of the message listener POJO, and pointed to a particular


bob.deremer wrote:
> Hi ActiveMQ experts,
> I have a scenario where I'd like to create a single MessageListener POJO,
> but it needs to be a listener on multiple queues.  The reason is that I'm
> trying to support the following 2 cases:
> 1) a pub/sub event model using Virtual Topics.  As a result, each
> subscriber (i.e. MessageListener) must be a separate Queue following the
> VirtualTopic naming convention.  This means that there could be 0 - many
> queues this single POJO may be receiving messages from - based on what
> events the POJO is subscribed.  In addition, these subscriber queues will
> be added/removed dynamically
> 2) a request/reply model with the same POJO.  This one is easy, as I'll
> create a single Queue/POJO to handle incoming request messages.
> So, is this possible?  And - even if it's possible, [IS IT A GOOD IDEA?] 
> While something may be possible, it might not be a design.  I cannot
> create a single POJO per destination and to support both request/response
> + event subscription - i will still need a minimum of 1 Topic + 1 Queue =
> 2 destinations going to the same POJO.
> Thanks in advance for any suggestions and please let me know if you need
> any further details,
> Bob DeRemer

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message