Producer Consumer queue in zookeeper

474 views Asked by At

I am new to zookeeper programming. I am trying to implement produce consumer queue using zookeeper.I am getting exception while initializing queue. In my zookeeper only root entry is there which is [zookeeper].

I am trying to execute code given at. http://zookeeper.apache.org/doc/r3.3.3/zookeeperTutorial.html#sc_producerConsumerQueues (Not pasting code here to keep post clean)

Exception:

org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /app1
at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at Queue.<init>(Queue.java:27)
at Queue.main(Queue.java:90)

Can any one advice me on  this?


Thanks
1

There are 1 answers

1
pasha701 On

You trying create child node (for ex. "/root/child") when parent node ("/root") does not exists, not created. Check that parent node is created.