You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Minh Tran <da...@gmail.com> on 2016/05/18 23:37:48 UTC

zookeeper route policy failover not working

Hi

I am trying to use the zookeeper route policy for failover and it does not work as I would expect. Here’s an example route.

ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper://zookeeperHost/myapp/myroute", 1);
from("quartz2:start").routePolicy(policy).log(“hello world”);

I ran 2 instances of this application. 

The first instance displays “hello world” every second. This is behaving as the master as expected.

The second instance only displays "java.lang.IllegalStateException: Zookeeper based route policy prohibits processing exchanges, stopping route and failing the exchange”. There is nothing else after this. This is behaving as the slave as expected.

Now if I kill the first instance, I would expect the second instance to become the master and to display “hello world” every second. It doesn’t do this. It continues to display nothing. It appears as though the zookeeper route policy is not watching when it becomes the master and resuming the route.



Re: zookeeper route policy failover not working

Posted by Minh Tran <da...@gmail.com>.
Thanks Claus.

I’ve found the ticket, it’s CAMEL-8208.

> On 20 May 2016, at 3:10 PM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> Check the JIRA what tickets has been reported about camel-zookeeper. I
> think we have something about this.
> 
> On Fri, May 20, 2016 at 7:05 AM, Minh Tran <da...@gmail.com> wrote:
>> 2.17.1
>> 
>>> On 20 May 2016, at 2:25 PM, Claus Ibsen <cl...@gmail.com> wrote:
>>> 
>>> What version of Camel is that?
>>> 
>>> On Thu, May 19, 2016 at 1:37 AM, Minh Tran <da...@gmail.com> wrote:
>>>> Hi
>>>> 
>>>> I am trying to use the zookeeper route policy for failover and it does not work as I would expect. Here’s an example route.
>>>> 
>>>> ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper://zookeeperHost/myapp/myroute", 1);
>>>> from("quartz2:start").routePolicy(policy).log(“hello world”);
>>>> 
>>>> I ran 2 instances of this application.
>>>> 
>>>> The first instance displays “hello world” every second. This is behaving as the master as expected.
>>>> 
>>>> The second instance only displays "java.lang.IllegalStateException: Zookeeper based route policy prohibits processing exchanges, stopping route and failing the exchange”. There is nothing else after this. This is behaving as the slave as expected.
>>>> 
>>>> Now if I kill the first instance, I would expect the second instance to become the master and to display “hello world” every second. It doesn’t do this. It continues to display nothing. It appears as though the zookeeper route policy is not watching when it becomes the master and resuming the route.
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: zookeeper route policy failover not working

Posted by Claus Ibsen <cl...@gmail.com>.
Check the JIRA what tickets has been reported about camel-zookeeper. I
think we have something about this.

On Fri, May 20, 2016 at 7:05 AM, Minh Tran <da...@gmail.com> wrote:
> 2.17.1
>
>> On 20 May 2016, at 2:25 PM, Claus Ibsen <cl...@gmail.com> wrote:
>>
>> What version of Camel is that?
>>
>> On Thu, May 19, 2016 at 1:37 AM, Minh Tran <da...@gmail.com> wrote:
>>> Hi
>>>
>>> I am trying to use the zookeeper route policy for failover and it does not work as I would expect. Here’s an example route.
>>>
>>> ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper://zookeeperHost/myapp/myroute", 1);
>>> from("quartz2:start").routePolicy(policy).log(“hello world”);
>>>
>>> I ran 2 instances of this application.
>>>
>>> The first instance displays “hello world” every second. This is behaving as the master as expected.
>>>
>>> The second instance only displays "java.lang.IllegalStateException: Zookeeper based route policy prohibits processing exchanges, stopping route and failing the exchange”. There is nothing else after this. This is behaving as the slave as expected.
>>>
>>> Now if I kill the first instance, I would expect the second instance to become the master and to display “hello world” every second. It doesn’t do this. It continues to display nothing. It appears as though the zookeeper route policy is not watching when it becomes the master and resuming the route.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: zookeeper route policy failover not working

Posted by Minh Tran <da...@gmail.com>.
2.17.1

> On 20 May 2016, at 2:25 PM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> What version of Camel is that?
> 
> On Thu, May 19, 2016 at 1:37 AM, Minh Tran <da...@gmail.com> wrote:
>> Hi
>> 
>> I am trying to use the zookeeper route policy for failover and it does not work as I would expect. Here’s an example route.
>> 
>> ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper://zookeeperHost/myapp/myroute", 1);
>> from("quartz2:start").routePolicy(policy).log(“hello world”);
>> 
>> I ran 2 instances of this application.
>> 
>> The first instance displays “hello world” every second. This is behaving as the master as expected.
>> 
>> The second instance only displays "java.lang.IllegalStateException: Zookeeper based route policy prohibits processing exchanges, stopping route and failing the exchange”. There is nothing else after this. This is behaving as the slave as expected.
>> 
>> Now if I kill the first instance, I would expect the second instance to become the master and to display “hello world” every second. It doesn’t do this. It continues to display nothing. It appears as though the zookeeper route policy is not watching when it becomes the master and resuming the route.
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: zookeeper route policy failover not working

Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel is that?

On Thu, May 19, 2016 at 1:37 AM, Minh Tran <da...@gmail.com> wrote:
> Hi
>
> I am trying to use the zookeeper route policy for failover and it does not work as I would expect. Here’s an example route.
>
> ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper://zookeeperHost/myapp/myroute", 1);
> from("quartz2:start").routePolicy(policy).log(“hello world”);
>
> I ran 2 instances of this application.
>
> The first instance displays “hello world” every second. This is behaving as the master as expected.
>
> The second instance only displays "java.lang.IllegalStateException: Zookeeper based route policy prohibits processing exchanges, stopping route and failing the exchange”. There is nothing else after this. This is behaving as the slave as expected.
>
> Now if I kill the first instance, I would expect the second instance to become the master and to display “hello world” every second. It doesn’t do this. It continues to display nothing. It appears as though the zookeeper route policy is not watching when it becomes the master and resuming the route.
>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2