dlouwers / reactive-consul

Consul client for Scala
MIT License
18 stars 7 forks source link

getService doesn't filter unhealthy services #26

Open sjoerdmulder opened 6 years ago

sjoerdmulder commented 6 years ago

Currently it seems that the ConsulHttpClient.getService method uses the Catalog https://www.consul.io/api/catalog.html#list-nodes-for-service to get all the endpoints for a service; but if a certain endpoint is considered unhealthy (for example since the consul agent is in failed mode due to network partition the client doesn't excluded it from the available nodes.

Maybe it's better to use the Health https://www.consul.io/api/health.html#list-nodes-for-service for this?

sjoerdmulder commented 6 years ago

FYI, we have added support ourselfs in the fork here: https://github.com/crobox/reactive-consul/commit/d0e041dc113bbfb0d3553ae5b75e934afac9ebfa thanks to @ecyshor