Ended up using ZooKeeperClusterService and ClusteredRoutePolicy of 
camel-zookeeper - which is very straightforward with good documentation.
Seems like camel-zookeeper has more mojo than zookeeper-master i.e I'm missing 
use case for zookeeper-master.

Dmitry
________________________________
From: Shultz, Dmitry <dmitry_shu...@kaltire.com>
Sent: 08 February 2022 17:50
To: users@camel.apache.org <users@camel.apache.org>
Subject: Migrating from camel-zookeeper to zookeeper-master

Hi All,

While migrating service that used camel-zookeeper (Camel 2.25.xx) to a newer 
Camel (3.14.1) zookeeper-master I'm facing this issue:

2022-02-08 17:25:14.265 [pool-26-thread-1] ERROR 
o.a.c.c.z.g.internal.ZooKeeperGroup -
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode 
for /camel
at org.apache.zookeeper.KeeperException.create(KeeperException.java:118)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1538)
at org.apache.curator.utils.ZKPaths.mkdirs(ZKPaths.java:351)
at org.apache.curator.utils.EnsurePath$InitialHelper$1.call(EnsurePath.java:156)
at 
org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:67)
at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:81)
at org.apache.curator.utils.EnsurePath$InitialHelper.ensure(EnsurePath.java:149)
at org.apache.curator.utils.EnsurePath.ensure(EnsurePath.java:102)
at 
org.apache.camel.component.zookeepermaster.group.internal.ZooKeeperGroup.refresh(ZooKeeperGroup.java:473)
at 
org.apache.camel.component.zookeepermaster.group.internal.RefreshOperation.invoke(RefreshOperation.java:30)
at 
org.apache.camel.component.zookeepermaster.group.internal.CompositeOperation.invoke(CompositeOperation.java:40)
at 
org.apache.camel.component.zookeepermaster.group.internal.ZooKeeperGroup.mainLoop(ZooKeeperGroup.java:585)
at 
org.apache.camel.component.zookeepermaster.group.internal.ZooKeeperGroup.access$200(ZooKeeperGroup.java:77)
at 
org.apache.camel.component.zookeepermaster.group.internal.ZooKeeperGroup$4.run(ZooKeeperGroup.java:183)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

The code looks similar to this:

MasterRoutePolicy master = new MasterRoutePolicy();                  
master.setZooKeeperUrl("${zookeeper.host}:${zookeeper.clientPort}/test/myService/doSomething");
master.setGroupName("myService");

        from("timer://myService?fixedRate=true&period=1800000")
                .routePolicy(master).noAutoStartup()
                .log("done");

It seems like the old camel-zookeeper component created the path automatically 
and it's not the case with the new zookeeper-master. Do I need to use new 
camel-zookeeper for path creation before the zookeeper-master kicks in? Some 
sample code would be appreciated.

Thanks,
Dmitry

Reply via email to