spring-cloud-consul icon indicating copy to clipboard operation
spring-cloud-consul copied to clipboard

ConsulDiscoveryClient getServices() does not take default-query-tag into account

Open fuleow opened this issue 7 years ago • 2 comments

We have a mix of different types of services registered in Consul and have tagged our Spring Boot based services with a special tag (e.g. sb). We need a way to be able to filter the list of services returned by ConsulDiscoveryClient to only include services based on this tag.

Our use case is very similar to what's described in #225 but the difference is we do not know the service names so we cannot directly use the enhancements from that issue.

It would be nice if the getServices() method filtered the list of services based on the value of default-query-tag if it is set.

fuleow avatar Sep 19 '18 23:09 fuleow

@fuleow Hi, did you manage to find a solution to this issue?

somejavadev avatar Jan 16 '19 16:01 somejavadev

@fuleow Hi, did you manage to find a solution to this issue?

Hi, please see the referenced PR for the solution. If you do not want to run your own patched version you can implement similar logic in a custom DiscoveryClient

fuleow avatar Jan 16 '19 17:01 fuleow