activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mquestioner <wqu...@avancetechnology.com>
Subject One session, multiple listening consumer?
Date Tue, 18 Aug 2009 03:20:05 GMT

Hi,

I want to know what would happen if I create one session and multiple
consumer w/ listeners, like:

   Session session = connection.createSession();
   TemporaryQueue q = session.createTemporaryQueue();
   for (i = 0; i < 10; i++) {
      MessageConsumer c = session.createConsumer(q);
      c.setMessageListener(this);
   }
   // onMessage just receive message and won't use session

Originally, this was a coding mistake when I tried to make my request/reply
loop faster with multiple listening threads, but it turns out working fine
as far as I can tell. As it is for implementing request/reply, this way I
don't have to create multiple temporary queue. 

I'm wondering if this practice is actually safe. Any idea?

Thanks

-- 
View this message in context: http://www.nabble.com/One-session%2C-multiple-listening-consumer--tp25017802p25017802.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message