activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robr <rowntree...@yahoo.com>
Subject messageListener, ASYNC, and threads in "onMessage()"
Date Sun, 15 Apr 2007 13:47:55 GMT

i read the post at : 
http://www.nabble.com/-activemq-user--two-threads-per-session-tf476901s2354.html#a1298138
which suggests an extra thread around the onMessage dispatcher. We have
occaisional issues in the scope of our 3.1 implementation of "onMessage()"
that could be cause by non-thread-safe code on a file Access. These could be
issues that only come up when the broker gets very busy as they affect only
5 - 10% of our message flow. 

I dont completely understand whether there are , in fact , multiple threads
that call onMessage? The javax.jms api says there is only 1.
http://java.sun.com/javaee/5/docs/api/javax/jms/MessageListener.html

Other posts suggest that when using listeners and ASYNC that you should be
prepared to have a 2nd onMessage call dispatched before the prior call has
finished. So , your call stak from onMessage should be thread-safe. 

I've decided to review the code and to make sure that we are not throwing
exceptions in the scope of "onMessage" and to protect the obvious objects in
case there is m-thread issue... but i dont really know...

comments appreciated 
-- 
View this message in context: http://www.nabble.com/messageListener%2C-ASYNC%2C-and-threads-in-%22onMessage%28%29%22-tf3579500s2354.html#a10002299
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message