dyrnq commented on issue #8856: URL: https://github.com/apache/apisix/issues/8856#issuecomment-1439574897
> > I lost here. > > `if consul_server.index ~= watch_result.headers['X-Consul-Index'] then` > > It also needs to be adjusted accordingly, becaus the health status is a dynamic value constantly changing. > > or maybe watch an associated health API `/health/checks/:service` to check X-Consul-Index`s change > > I think you do not need change this `if consul_server.index ~= watch_result.headers['X-Consul-Index'] then`. the value of `X-Consul-Index`, indicating that the client wishes to wait for any changes subsequent to that index, if watch `/health/checks/:service` API, that will make all watch request waiting for any changes. The second reason is, the watch API `/catalog/services` just ONE request; for the watch API `/health/checks/:service` has N (number of services) requests. when an node from health to unhealth, the `/catalog/services` X-Consul-Index has no change, then will not go to fetch the new health nodes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
