Hi
I would like to monitoring the number of items in a queue.
For that, in the queue producer, I defined a listener
CuratorListener listener = new CuratorListener() {
@Override
public void eventReceived(final CuratorFramework framework_,
CuratorEvent event) throws Exception {
Stat stat =
framework_.checkExists().watched().forPath(Utils.CRAWL_QUEUE_PATH);
System.out.println("!! = " + stat.getNumChildren());
}
};
framework.getCuratorListenable().addListener(listener);
However, this listener does not catch any event!
If I change the event watched to be
List<String> children =
framework.getChildren().watched().forPath(Utils.CRAWL_QUEUE_PATH);
It matches all the event on the queue.
Do you have any hint?
Best regards
Benjamin