You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Stephen <re...@inode.serveftp.com> on 2009/03/02 07:33:40 UTC

Roundrobin failover

Hi,

I am testing failover Qpid Java Clients against C++ broker with roundrobin 
method
I suspect the parameter cyclecount does not take any effect

There are 2 C++ broker BrokerA and BrokerB, and both are up initially
There is one client using the connection URL:
amqp://guest:guest@client01/development?brokerlist='tcp://brokera:5678?connecttimeout='2000';tcp://brokerb:5678?connecttimeout='2000'';failover='roundrobin';cyclecount='9999'

Steps are as follow:
Start Java client
>From netstat, the client connects BrokerA initially
Shutdown BrokerA
>From netstat, the client connects BrokerB, failover is ok
Start BrokerA again
Shutdown BrokerB
>From netstat, the client does not make connection to BrokerA
>From log:
141859.947 DEBUG FailoverPolicy All failover methods exhausted

I dun think 'all failover methods exhausted', as cyclecount is very big, it 
should goes over again from first broker.

Hopefully I am illustrating clear enough

Regards,
Stephen Lau 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Roundrobin failover

Posted by Carl Trieloff <cc...@redhat.com>.
If you are on M4, the trunk has a fix for dynamically updating the list 
of reconnection URL's for
Java. I believe that Rajith committed it if you want to look at the logs.

Carl.



Martin Ritchie wrote:
> Hi Stephen,
>
> Thanks for your email. The documentation was out of step with the
> code. I've updated the wiki to reflect the state of the code:
> http://cwiki.apache.org/confluence/display/qpid/Connection+URL+Format
>
> If you update your url as follows then you should see the behaviour you expect:
> amqp://guest:guest@client01/development?brokerlist='tcp://brokera:5678?connecttimeout='2000';tcp://brokerb:5678?connecttimeout='2000'';failover='roundrobin?cyclecount='9999''
>
> 2009/3/2 Stephen Lau <st...@xml-asia.org>:
>   
>> Does the problem relate to
>>
>> org/apache/qpid/jms/FailoverPolicy.java
>>
>>   public FailoverPolicy(ConnectionURL connectionDetails, AMQConnection conn)
>>   {
>>       FailoverMethod method;
>>
>>       // todo This should be integrated in to the connection url when it
>> supports
>>       // multiple strategies.
>>
>>       _methodsRetries = 0; <<< change this value to a very large number, 999
>>
>>
>> ----- Original Message ----- From: "Stephen" <re...@inode.serveftp.com>
>> To: <us...@qpid.apache.org>
>> Sent: Monday, March 02, 2009 2:33 PM
>> Subject: Roundrobin failover
>>
>>
>>     
>>> Hi,
>>>
>>> I am testing failover Qpid Java Clients against C++ broker with roundrobin
>>> method
>>> I suspect the parameter cyclecount does not take any effect
>>>
>>> There are 2 C++ broker BrokerA and BrokerB, and both are up initially
>>> There is one client using the connection URL:
>>>
>>> amqp://guest:guest@client01/development?brokerlist='tcp://brokera:5678?connecttimeout='2000';tcp://brokerb:5678?connecttimeout='2000'';failover='roundrobin';cyclecount='9999'
>>>
>>> Steps are as follow:
>>> Start Java client
>>> From netstat, the client connects BrokerA initially
>>> Shutdown BrokerA
>>> From netstat, the client connects BrokerB, failover is ok
>>> Start BrokerA again
>>> Shutdown BrokerB
>>> From netstat, the client does not make connection to BrokerA
>>> From log:
>>> 141859.947 DEBUG FailoverPolicy All failover methods exhausted
>>>
>>> I dun think 'all failover methods exhausted', as cyclecount is very big,
>>> it should goes over again from first broker.
>>>
>>> Hopefully I am illustrating clear enough
>>>
>>> Regards,
>>> Stephen Lau
>>>
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>>
>>     
>
>
>
>   


Re: Roundrobin failover

Posted by Martin Ritchie <ri...@apache.org>.
Hi Stephen,

Thanks for your email. The documentation was out of step with the
code. I've updated the wiki to reflect the state of the code:
http://cwiki.apache.org/confluence/display/qpid/Connection+URL+Format

If you update your url as follows then you should see the behaviour you expect:
amqp://guest:guest@client01/development?brokerlist='tcp://brokera:5678?connecttimeout='2000';tcp://brokerb:5678?connecttimeout='2000'';failover='roundrobin?cyclecount='9999''

2009/3/2 Stephen Lau <st...@xml-asia.org>:
> Does the problem relate to
>
> org/apache/qpid/jms/FailoverPolicy.java
>
>   public FailoverPolicy(ConnectionURL connectionDetails, AMQConnection conn)
>   {
>       FailoverMethod method;
>
>       // todo This should be integrated in to the connection url when it
> supports
>       // multiple strategies.
>
>       _methodsRetries = 0; <<< change this value to a very large number, 999
>
>
> ----- Original Message ----- From: "Stephen" <re...@inode.serveftp.com>
> To: <us...@qpid.apache.org>
> Sent: Monday, March 02, 2009 2:33 PM
> Subject: Roundrobin failover
>
>
>> Hi,
>>
>> I am testing failover Qpid Java Clients against C++ broker with roundrobin
>> method
>> I suspect the parameter cyclecount does not take any effect
>>
>> There are 2 C++ broker BrokerA and BrokerB, and both are up initially
>> There is one client using the connection URL:
>>
>> amqp://guest:guest@client01/development?brokerlist='tcp://brokera:5678?connecttimeout='2000';tcp://brokerb:5678?connecttimeout='2000'';failover='roundrobin';cyclecount='9999'
>>
>> Steps are as follow:
>> Start Java client
>> From netstat, the client connects BrokerA initially
>> Shutdown BrokerA
>> From netstat, the client connects BrokerB, failover is ok
>> Start BrokerA again
>> Shutdown BrokerB
>> From netstat, the client does not make connection to BrokerA
>> From log:
>> 141859.947 DEBUG FailoverPolicy All failover methods exhausted
>>
>> I dun think 'all failover methods exhausted', as cyclecount is very big,
>> it should goes over again from first broker.
>>
>> Hopefully I am illustrating clear enough
>>
>> Regards,
>> Stephen Lau
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



-- 
Martin Ritchie

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Roundrobin failover

Posted by Stephen Lau <st...@xml-asia.org>.
Does the problem relate to

org/apache/qpid/jms/FailoverPolicy.java

    public FailoverPolicy(ConnectionURL connectionDetails, AMQConnection 
conn)
    {
        FailoverMethod method;

        // todo This should be integrated in to the connection url when it 
supports
        // multiple strategies.

        _methodsRetries = 0; <<< change this value to a very large number, 
999


----- Original Message ----- 
From: "Stephen" <re...@inode.serveftp.com>
To: <us...@qpid.apache.org>
Sent: Monday, March 02, 2009 2:33 PM
Subject: Roundrobin failover


> Hi,
>
> I am testing failover Qpid Java Clients against C++ broker with roundrobin 
> method
> I suspect the parameter cyclecount does not take any effect
>
> There are 2 C++ broker BrokerA and BrokerB, and both are up initially
> There is one client using the connection URL:
> amqp://guest:guest@client01/development?brokerlist='tcp://brokera:5678?connecttimeout='2000';tcp://brokerb:5678?connecttimeout='2000'';failover='roundrobin';cyclecount='9999'
>
> Steps are as follow:
> Start Java client
> From netstat, the client connects BrokerA initially
> Shutdown BrokerA
> From netstat, the client connects BrokerB, failover is ok
> Start BrokerA again
> Shutdown BrokerB
> From netstat, the client does not make connection to BrokerA
> From log:
> 141859.947 DEBUG FailoverPolicy All failover methods exhausted
>
> I dun think 'all failover methods exhausted', as cyclecount is very big, 
> it should goes over again from first broker.
>
> Hopefully I am illustrating clear enough
>
> Regards,
> Stephen Lau
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org