I’ll bet you had a bad node in queue’s path. If you look at the logs there will 
be a message regarding these. See this Tech Note: 
https://cwiki.apache.org/confluence/display/CURATOR/TN7


From: Donald Laidlaw [email protected]
Reply: [email protected] [email protected]
Date: July 2, 2014 at 8:33:40 AM
To: [email protected] [email protected]
Subject:  Re: DistributedQueue - subscriber not receiving all messages  

I stopped zookeeper and deleted all its data and started fresh.

Now, I am receiving queued events in the consumer as expected. No code changes!

For some reason there must have been a problem with either the zookeeper data 
or the instance that was running. This is very strange indeed. I will see if it 
happens again and report it.

Thanks,
-Don



Well, I don't think the producer side is consuming them, because I can see the 
messages when using the command line client. But here is the producer code:

managerNodeStateQueue = QueueBuilder.builder(curatorFramework, 
null, 
new JsonQueueSerializer<>(NodeStateEvent.class),
queuePath).buildQueue();
managerNodeStateQueue.start();
...
managerNodeStateQueue.put(new NodeStateEvent("Running"));

With the command line client I can "ls /manager/nodeStateQueue" and see the 
messages. They stay in the queue after they are written. I need to stop and 
start the JVM of the consumer to actually consume them.

The queuePath variable is set to "/manager/nodeStateQueue".

Thanks for looking.


Reply via email to