camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Minh Tran (JIRA)" <>
Subject [jira] [Comment Edited] (CAMEL-9851) Zookeeper RoutePolicy failing to create znode
Date Sun, 17 Apr 2016 22:59:25 GMT


Minh Tran edited comment on CAMEL-9851 at 4/17/16 10:59 PM:

-Just tried the fix in the snapshot and it works, thank you very much!-

Sorry that was premature, I wasn't using your fix. When I actually tried to use the snapshot
it didn't work but I think it's because the Apache Maven snapshot repo is out of date (

And I can't find an updated one. I'll just test this when it is released. Thanks for your
help anyway.

was (Author: mtran):
Just tried the fix in the snapshot and it works, thank you very much!

> Zookeeper RoutePolicy failing to create znode
> ---------------------------------------------
>                 Key: CAMEL-9851
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-zookeeper
>    Affects Versions: 2.17.0
>         Environment: mac
>            Reporter: Minh Tran
>            Assignee: Claus Ibsen
>             Fix For: 2.16.4, 2.17.1, 2.18.0
> I am trying to setup a ZooKeeper route policy like this
> ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper:localhost/regexTest1?create=true",
> from("direct:start").routePolicy(policy).to(“mock:end”);
> And when I run my unit test to trigger the route, I get the following exception in my
> {noformat}
> Node '/regexTest1/' did not exist,
creating it.
> Error setting up election node /regexTest1/
> org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /regexTest1/
> 	at org.apache.zookeeper.KeeperException.create( ~[zookeeper-3.4.8.jar:3.4.8--1]
> 	at org.apache.zookeeper.KeeperException.create( ~[zookeeper-3.4.8.jar:3.4.8--1]
> 	at org.apache.zookeeper.ZooKeeper.create( ~[zookeeper-3.4.8.jar:3.4.8--1]
> 	at org.apache.camel.component.zookeeper.operations.CreateOperation.getResult(
> 	at org.apache.camel.component.zookeeper.operations.ZooKeeperOperation.get(
> 	at org.apache.camel.component.zookeeper.ZookeeperProducer.createNode(
> 	at org.apache.camel.component.zookeeper.ZookeeperProducer.synchronouslySetData(
> 	at org.apache.camel.component.zookeeper.ZookeeperProducer.process(
> 	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(
> 	at org.apache.camel.processor.CamelInternalProcessor.process(
> 	at org.apache.camel.util.AsyncProcessorHelper.process(
> 	at org.apache.camel.processor.UnitOfWorkProducer.process(
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer( [camel-core-2.17.0.jar:2.17.0]
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer( [camel-core-2.17.0.jar:2.17.0]
> 	at org.apache.camel.impl.ProducerCache.doInProducer( [camel-core-2.17.0.jar:2.17.0]
> 	at org.apache.camel.impl.ProducerCache.sendExchange( [camel-core-2.17.0.jar:2.17.0]
> 	at org.apache.camel.impl.ProducerCache.send( [camel-core-2.17.0.jar:2.17.0]
> 	at org.apache.camel.impl.DefaultProducerTemplate.send(
> 	at org.apache.camel.component.zookeeper.policy.ZooKeeperElection.createCandidateNode(
> 	at org.apache.camel.component.zookeeper.policy.ZooKeeperElection.testAndCreateCandidateNode(
> 	at org.apache.camel.component.zookeeper.policy.ZooKeeperElection.isMaster(
> 	at org.apache.camel.component.zookeeper.policy.ZooKeeperRoutePolicy.onExchangeBegin(
> 	at org.apache.camel.processor.CamelInternalProcessor$RoutePolicyAdvice.before(
> {noformat}
> It looks like it knows the znode doesn’t exist but seems to be unable to create it?
From the zookeeper server side logs, I can see incoming connections and it returning the error
that the znode doesn’t exist but doesn’t look like there’s any attempts to create it
after that.
> I’ve tried using the zookeeper component directly in my route and I am able to create/write/read
from a znode fine so it seems like it’s just failing in the route policy for some reason.
> I am using Camel 2.17.0 and zookeeper 3.4.8
> I’ve investigated this further and the exception is thrown from the ZooKeeper.create
method. Camel is actually trying to create a znode with a path /regexTest1/
without creating the parent node /regexTest1 first. 
> According to the Zookeeper.create method documentation 
> "If the parent node does not exist in the ZooKeeper, a KeeperException
>     * with error code KeeperException.NoNode will be thrown."
> And I don’t see anywhere in Camel’s code where it is creating the parent nodes first
before attempting to create the final node for master election.
> So I removed the path off the uri for the route policy like this
> ZooKeeperRoutePolicy policy = new ZooKeeperRoutePolicy("zookeeper:localhost", 1);
> And it has gotten past that error but now has encountered a different error where it
has trouble creating a threadpool.
> {noformat}
> 2016-04-08 11:47:15,071 [main] ERROR org.apache.camel.component.zookeeper.policy.ZooKeeperElection
- Error configuring ZookeeperElection
> java.lang.IllegalArgumentException: id for thread pool org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@1ec912d7[Running,
pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0][Camel-Zookeeper
Ops executor] must be specified and not empty
> 	at org.apache.camel.util.ObjectHelper.notEmpty( ~[camel-core-2.16.0.jar:2.16.0]
> 	at org.apache.camel.impl.DefaultExecutorServiceManager.onThreadPoolCreated(
> 	at org.apache.camel.impl.DefaultExecutorServiceManager.newThreadPool(
> 	at org.apache.camel.impl.DefaultExecutorServiceManager.newFixedThreadPool(
> 	at org.apache.camel.component.zookeeper.ZooKeeperConsumer.doStart(
> 	at ~[camel-core-2.16.0.jar:2.16.0]
> 	at org.apache.camel.impl.DefaultCamelContext.startService(
> {noformat}

This message was sent by Atlassian JIRA

View raw message