activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tendlu <>
Subject Missing messages in multithreaded producer
Date Thu, 06 Sep 2007 17:12:04 GMT

Using ActiveMQ 4.1

I have a producer that does the following -

1. main thread creates a Connectionfactory using tcp
2. creates a few threads - say 5
3. each thread creates a new Connection and a new Session using the
connectionfactory created in the main thread. Session is created with
auto-ack and no transaction
4. each thread creates a producer(Queue) and a message and sends it to a
Queue. This is done a few times in a loop (say 10)
5. main thread waits for the spawned threads to complete the tasks

In the above example the queue should have 5x10 = 50 msgs on the broker. But
I consistently don't see 50msgs. I check this using jconsole. 

Broker : persistent=true , using kaha persistence
Connectionfactory: AsyncSend=false

Can you please let me know if I am missing something or is this is a known
bug in Active MQ4.1?

BTW, If I run my producer as a single threaded appplication then I see all
messages in the broker. If I run multiple instances of the single threaded
producer application, then I see all messages. 


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

View raw message