سؤال

I have a use case where I want to read the zookeeper nodes periodically. Is there any way I can do this in zookeeper asynchronously?

I read about exists() but it call backs only if there is a change in node data.

هل كانت مفيدة؟

المحلول

If you are using Java with Spring, create a component with a method with the annotation @Scheduled. Add a delay and inside the method put the code where you read the zNode and check if the other application is alive.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top