You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nathan Stien (JIRA)" <ji...@apache.org> on 2015/05/01 22:25:07 UTC

[jira] [Commented] (CAMEL-7501) Only one ZooKeeperRoutePolicy possible

    [ https://issues.apache.org/jira/browse/CAMEL-7501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14523847#comment-14523847 ] 

Nathan Stien commented on CAMEL-7501:
-------------------------------------

I believe this bug is caused by the generated names for the zookeeper election routes.  In ZookeeperElection.java, it generates a candidate name which is the machine's hostname followed by a UUID.  But later when it goes to set up the election route, it only uses the first 8 chars of candidateName, leading to name collisions on any subsequent election routes, if your hostname is more than 8 chars long.

            from(zep).id("election-route-" + candidateName.substring(0, 8)).sort(body(), comparator).process(new Processor() { ... })

I'm not sure if there is a length limit on camel route IDs that lead to this very conservative 8 char policy, but I think if we removed the .substring(0,8) call, this would properly support multiple routes.


> Only one ZooKeeperRoutePolicy possible
> --------------------------------------
>
>                 Key: CAMEL-7501
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7501
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-zookeeper
>    Affects Versions: 2.12.3
>            Reporter: Scott Stults
>             Fix For: Future
>
>
> If two ZooKeeperRoutePolicy's are created and used in separate routes, only one leader election route gets created. This effectively nullifies the route policy for the second route, meaning it works regardless of leadership status (even on the other route).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)