You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by yq8925 <yq...@hotmail.com> on 2013/07/31 05:59:26 UTC

ActiveMQ NMS, connection will be hung with an invalid URL

In NMS.ActiveMQ1.5.6 and 1.6.0, if target JMS server URL is invalid or no
responsible, the client program will be hung at code "ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge)".

The "connection.RequestTimeout" does not work here...

Anyone could help on it?



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-NMS-connection-will-be-hung-with-an-invalid-URL-tp4669903.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ NMS, connection will be hung with an invalid URL

Posted by Jim Gomes <e....@gmail.com>.
Use the following URL option to avoid hanging on startup when using the
failover transport.

activemq:failover:tcp://activemqhost:61616*
?transport.StartupMaxReconnectAttempts=3*

Set the startup max reconnect attempts to whatever number you want.  It
will eventually stop trying at start up.  Once it successfully connects at
least once, then it will use normal failover semantics to continually retry
connecting in case of a disconnect.



On Wed, Jul 31, 2013 at 11:06 AM, Timothy Bish <ta...@gmail.com> wrote:

> On 07/30/2013 11:59 PM, yq8925 wrote:
>
>> In NMS.ActiveMQ1.5.6 and 1.6.0, if target JMS server URL is invalid or no
>> responsible, the client program will be hung at code "ISession session =
>> connection.CreateSession(**AcknowledgementMode.**AutoAcknowledge)".
>>
>> The "connection.RequestTimeout" does not work here...
>>
>> Anyone could help on it?
>>
>>
>>
>> --
>> View this message in context: http://activemq.2283324.n4.**
>> nabble.com/ActiveMQ-NMS-**connection-will-be-hung-with-**
>> an-invalid-URL-tp4669903.html<http://activemq.2283324.n4.nabble.com/ActiveMQ-NMS-connection-will-be-hung-with-an-invalid-URL-tp4669903.html>
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>  Sounds like you are using the failover transport.  I'd guess you need to
> set the timeout option on the failover transport in order to have the send
> attempt bail if it can't connect after some time.
>
> --
> Tim Bish
> Sr Software Engineer | RedHat Inc.
> tim.bish@redhat.com | www.fusesource.com | www.redhat.com
> skype: tabish121 | twitter: @tabish121
> blog: http://timbish.blogspot.com/
>
>

Re: ActiveMQ NMS, connection will be hung with an invalid URL

Posted by Timothy Bish <ta...@gmail.com>.
On 07/30/2013 11:59 PM, yq8925 wrote:
> In NMS.ActiveMQ1.5.6 and 1.6.0, if target JMS server URL is invalid or no
> responsible, the client program will be hung at code "ISession session =
> connection.CreateSession(AcknowledgementMode.AutoAcknowledge)".
>
> The "connection.RequestTimeout" does not work here...
>
> Anyone could help on it?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-NMS-connection-will-be-hung-with-an-invalid-URL-tp4669903.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Sounds like you are using the failover transport.  I'd guess you need to 
set the timeout option on the failover transport in order to have the 
send attempt bail if it can't connect after some time.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/