You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Dejan Bosanac <de...@nighttale.net> on 2009/02/16 11:01:46 UTC

Re: ActiveMQ client library hanging indefinitely when attempting to use failover URL in conjunction with connection paramters

Hi,

you should try setting jms.prefetchPolicy.all to failover transport. The
following URL works just fine:

failover:(tcp://localhost:61616?wireFormat.maxInactivityDuration=0&keepAlive=true)?jms.prefetchPolicy.all=500&initialReconnectDelay=10000&useExponentialBackOff=false&maxReconnectAttempts=0&randomize=false

BTW. you should turn on debugging on the FailoverTransport if you experience
any issues. It will help you find out the problem.


Dejan Bosanac wrote:
> 
> Hi,
> 
> can you file this as Jira issue, ideally with the test case?
> 
> Regards
> --
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> On Tue, Jan 6, 2009 at 8:35 PM, brent.nash
> <br...@jpl.nasa.gov>wrote:
> 
>>
>> ###############################
>> # which version of ActiveMQ are you using?
>> ###############################
>>
>> I'm using version ActiveMQ 5.0.0.23-fuse
>>
>> ###############################
>> # are you using queues or topics and are you using persistent or non
>> persistent messaging?
>> ###############################
>>
>> I'm using topics and my problematic client is strictly a publisher and my
>> problem occurs before any messages are actually sent, though the messages
>> are Non-Persistent if that helps.
>>
>> ###############################
>> # details of your environment can help too such as
>> ###############################
>>
>> Mac OS X 10.5.5 with Java version "J2SE (build 1.5.0_16-b06-284)"
>>
>> I'm running the message bus standalone and running the client standalone,
>> there are no application servers involved.
>>
>> ###############################
>> Problem description
>> ###############################
>>
>> I'm trying to implement a simple auto-reconnect strategy for my
>> standalone
>> client.  It creates two publishers to two different topics.  There are
>> certain parameters that when added to the connection URL, cause my client
>> to
>> hang indefinitely between creating the first and second publisher.  The
>> publishers are created within a loop, so there is no code in between
>> creating the first publisher and the second.  In my jndi.properties file,
>> I've tried multiple things.
>>
>> This works (no parameters on the reconnect URL):
>>
>>
>> java.naming.provider.url=failover://(tcp://localhost:61614)?initialReconnectDelay=10000&useExponentialBackOff=false&maxReconnectAttempts=0&randomize=false
>>
>> This works also (adding
>> "wireFormat.maxInactivityDuration=0&keepAlive=true"
>> to reconnect URL):
>>
>>
>> java.naming.provider.url=failover://(tcp://localhost:61614?wireFormat.maxInactivityDuration=0&keepAlive=true)?initialReconnectDelay=10000&useExponentialBackOff=false&maxReconnectAttempts=0&randomize=false
>>
>> As soon as I attempt to add more parameters to the URL, however, things
>> go
>> awry.  For instance, this entry (by just adding
>> "jms.prefetchPolicy.all=500"
>> to reconnect URL):
>>
>>
>> java.naming.provider.url=failover://(tcp://localhost:61614?jms.prefetchPolicy.all=500&wireFormat.maxInactivityDuration=0&keepAlive=true)?initialReconnectDelay=10000&useExponentialBackOff=false&maxReconnectAttempts=0&randomize=false
>>
>> My application will create my first publisher and then hang indefinitely
>> without creating my second publisher.  At this point, SIGTERM and SIGQUIT
>> signals do nothing, I have to send a SIGKILL to get rid of the java
>> process.
>>
>> Ultimately, I would like to use this URL:
>>
>>
>> java.naming.provider.url=failover://(tcp://localhost:61614?connectionTimeout=0&jms.prefetchPolicy.all=500&jms.useCopyOnSend=false&jms.useCompression=true&wireFormat.maxInactivityDuration=0&keepAlive=true)?initialReconnectDelay=10000&useExponentialBackOff=false&maxReconnectAttempts=0&randomize=false
>>
>> But I can't because of this freeze I keep encountering.
>>
>> I've checked some past posts such as:
>>
>>
>> http://www.nabble.com/ActiveMQ-failover-url-problems-tt13764784.html#a13764784
>>
>> But they don't seem to be able to help me.
>>
>> In my code, the freeze seems to occur as soon as I call
>> TopicConnection.start() for the TopicConnection for my first publisher.
>>
>> Thoughts?
>> --
>> View this message in context:
>> http://www.nabble.com/ActiveMQ-client-library-hanging-indefinitely-when-attempting-to-use-failover-URL-in-conjunction-with-connection-paramters-tp21317433p21317433.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -----
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 


-----
Dejan Bosanac

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net
-- 
View this message in context: http://www.nabble.com/ActiveMQ-client-library-hanging-indefinitely-when-attempting-to-use-failover-URL-in-conjunction-with-connection-paramters-tp21317433p22034450.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.