activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksi Kallio <>
Subject How to create temporary topic without blocking?
Date Mon, 06 Feb 2012 08:51:18 GMT

We have client apps connecting to our server environment using ActiveMQ, 
with failover enabled. Our users can have the app open on a laptop while 
moving from one network to another or to a completely unconnected place.

ActiveMQ does beautiful failover, keeping the system running between 
network connections. However there are certain cases when we would like 
to use our own "failover mechanism".

To do that, we would need to be able to check connection state or have 
an exception thrown when connection is not active. Now when you try to 
send a message and create a temporary reply topic without network 
connection it hangs on session.createTemporaryTopic().

How to not block on session.createTemporaryTopic() when the network is 

I tried setting useAsyncSend to true and checking 
connection.isTransportFailed() before calling createTemporaryTopic(), 
but neither of them helped.

Creating a throwaway thread for the send attempt is a solution, but a 
very crude one.

All the best,

View raw message