Hi

I am trying to setup a ZooKeeper route policy like this

ZooKeeperRoutePolicy policy = new 
ZooKeeperRoutePolicy("zookeeper:localhost/regexTest1?create=true", 1);
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 logs

Node '/regexTest1/192.168.202.25-3306c9d2-1354-4dbe-aaff-846eee5bb60d' did not 
exist, creating it.
Error setting up election node 
/regexTest1/192.168.202.25-25829641-de1f-4389-9bb6-2967ea60de1a
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode 
for /regexTest1/192.168.202.25-25829641-de1f-4389-9bb6-2967ea60de1a
        at 
org.apache.zookeeper.KeeperException.create(KeeperException.java:111) 
~[zookeeper-3.4.8.jar:3.4.8--1]
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) 
~[zookeeper-3.4.8.jar:3.4.8--1]
        at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783) 
~[zookeeper-3.4.8.jar:3.4.8--1]
        at 
org.apache.camel.component.zookeeper.operations.CreateOperation.getResult(CreateOperation.java:52)
 ~[camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.operations.ZooKeeperOperation.get(ZooKeeperOperation.java:70)
 ~[camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.ZookeeperProducer.createNode(ZookeeperProducer.java:222)
 ~[camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.ZookeeperProducer.synchronouslySetData(ZookeeperProducer.java:238)
 ~[camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.ZookeeperProducer.process(ZookeeperProducer.java:88)
 ~[camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
 ~[camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
 [camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
 [camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
 [camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:412) 
[camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:380) 
[camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:270) 
[camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:380) 
[camel-core-2.17.0.jar:2.17.0]
        at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:205) 
[camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:119)
 [camel-core-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.policy.ZooKeeperElection.createCandidateNode(ZooKeeperElection.java:146)
 [camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.policy.ZooKeeperElection.testAndCreateCandidateNode(ZooKeeperElection.java:116)
 [camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.policy.ZooKeeperElection.isMaster(ZooKeeperElection.java:92)
 [camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.component.zookeeper.policy.ZooKeeperRoutePolicy.onExchangeBegin(ZooKeeperRoutePolicy.java:79)
 [camel-zookeeper-2.17.0.jar:2.17.0]
        at 
org.apache.camel.processor.CamelInternalProcessor$RoutePolicyAdvice.before(CamelInternalProcessor.java:483)
 [camel-core-2.17.0.jar:2.17.0]
        

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

ps there’s an error in the Camel zookeeper documentation

from("zookeeper://localhost:39913/somepath/somenode?awaitCreation=true").to("mock:result”);

But there's no option called awaitCreation available on the component.

Reply via email to