activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <>
Subject Re: How to create temporary topic without blocking?
Date Mon, 06 Feb 2012 15:06:29 GMT
You need to use the Failover transport options to configure the
transport to fail after some amount of time, the timeout option will let
you do that, see:

On Mon, 2012-02-06 at 10:51 +0200, Aleksi Kallio wrote: 
> Hi,
> 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 
> disconnected?
> 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,
> Aleksi

Tim Bish
Sr Software Engineer | FuseSource Corp |
skype: tabish121 | twitter: @tabish121

View raw message