activemq-users mailing list archives

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


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);
   // 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?


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

View raw message