activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sitsky <>
Subject onMessage() synchronisation requirements for queue+topic consumer
Date Mon, 01 Dec 2008 09:42:52 GMT

I think this might be an easy question, but I have an application where
my onMessage() handler is a consumer for both topic and queue messages.

The topic and queue consumer are derived from the same ActiveMQ session,
so I was under the impression that my onMessage() handler would not be
called concurrently.

However, I have a list that I iterate over and add elements too, which
is only called via my onMessage() handler, and I see concurrency issues

When I add synchronized to the onMessage() method, all works well.

Am I doing something wrong, or is this the expected behaviour?


Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web:                            Fax: +61 2 9212 6902

View raw message