Question

I have few doubts on how producer consumer recipe will work with Zookeeper.

All the examples I have seen so far have producers and consumers in the same java processes as separate thread. But the whole point of being distributed is to have different instances ( multiple ) of producer and consumer.

having different instances of producers and consumer means no local locks ( syntonization ) will be of any use.

Also because multiple processes are watching the same root queue node, they all will start processing a particular incoming entry.

What I am getting wrong here ???

Était-ce utile?

La solution

FYI - to see an example of producer/consumer in ZooKeeper have a look at Curator (disclaimer: I'm the author of Curator): http://curator.incubator.apache.org/curator-recipes/distributed-queue.html

NOTE: It's my opinion that ZooKeeper is a bad choice for queues. Here's a post that explains why: https://cwiki.apache.org/confluence/display/CURATOR/TN4

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top