The callbacks to your application both onMessage and onException can and do occur in the context of another thread. There is no way to turn this off, its part of the architecture. Its up to the client application to appropriately handle this with locking etc.
Regards
Tim.

gali_ka wrote:
Hi,
i'm using activemq in my c++ application. I have one connection and one
session for this connection. I see that the session (SessionExecutor) starts
a new thread. I set my class that starts the connection and the session to
be the exceptionListener. Does that mean that the onException will be called
from the session Thread? If so, then i get here a thread unsafe application.
During a connect I update my members ( session, producer and consumer for
example), if an exception will occur, i will access my members from two
different threads. Am I correct?
what is the possible solution? can i disable session thread? Do i need to
lock my members?
I saw some explanation about optimizedDispatch=true option that looked
suitable for disabling session thread, but couldn't find a cms support for
this. Any help will be appreciated.



Reply via email to