Notifying an instance as down using a ServiceCache in Curator

梦想与她 提交于 2020-01-05 04:10:11

问题


The documentation for Curator (http://curator.apache.org/curator-x-discovery/index.html) says:

If a particular instance has an I/O error, etc. you should call ServiceProvider.noteError() passing in the instance.

I am using a ServiceCache to get my instances, rather than a ServiceProvider (see Using selection strategies with a cache in Curator).

Where can I find the noteError() method here? I can't find it on the cache object


回答1:


There is no noteError() on a ServiceCache, however as @Randgalt notes (https://stackoverflow.com/a/57059811/2048051) the best way is to not use a ServiceCache but rather just use ServiceProvider, because in the background that uses a cache anyway, and it has the noteError() method available.

https://issues.apache.org/jira/browse/CURATOR-531 has been raised to make the documentation clearer



来源:https://stackoverflow.com/questions/57058817/notifying-an-instance-as-down-using-a-servicecache-in-curator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!