activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chasta <>
Subject Dynamic topics, in-VM: MessageListener not being invoked
Date Sat, 04 Nov 2006 12:58:13 GMT

I have a problem; I've been banging my head against this for quite some time
now so any advice would be much appreciated. I've searched the archives and
the docs but didn't find a solution.

I'm using ActiveMQ in a Spring-based application, but w/o Spring's specific
JMS features (e.g., I'm not using JmsTemplate, etc). Using an embedded
broker, the in-VM transport and (only) pub/sub, synchronous message
consuming works fine but asynchronous consumption (using a message listener
which is set to the consumer) does not work – the MessageListener just never
gets called.

By the way, what I really need is for each thread to consume its messages
synchronously, but from a single channel, to which all messages in all
topics that particular thread is subscribed to will arrive. Since I didn't
see a simpler way for JMS to allow this (and quite possibly I've missed
something...), I implemented this by each thread having a blocking
concurrent queue to which its message listener (same thread-safe instance
for all consumers of a given thread) enqueues the messages' payload.

My application is moderately parallelized; there will be ~20 modules, each
running in its own thread. Currently they are running in the same VM, but
the future will demand involving several hosts. The plan is for all of the
threads to communicate transparently via JMS, not knowing if the recipients
share the VM with them or not.

Another, related question: The topics are created dynamically. Is there any
problem with 2 (or more) threads calling 'createTopic' on the same topic
(same topic name) ? (One publisher and one subscriber, at the least). Or
should I share the same Topic object between the threads, when they're in
the same VM?


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

View raw message