Provide a way to listen to specific services instead of the whole catalog
See original GitHub issuespring-cloud-consul provides a Consul Catalog Watch that publishes heartbeat events on catalog changes. In an environment with many services the catalog can change rapidly (multiple times per second) causing heartbeat events to trigger for services which the application is not interested in.
For example, this mechanism is used in Spring Cloud Config Client if discovery is enabled link
In practice the config client is only interested in updates to the spring-cloud-config-server but this triggers each time the catalog updates.
The catalog services watch can already be disabled. It would be very useful if an alternative heartbeat event producer can be implemented which takes a list of relevant services and only publishes heartbeat events when those specific services are updated.
Currently any micro service in our organization will start generating many requests to consul just by adding spring-cloud-starter-consul-discovery. While the watch-delay is configurable it’s less than ideal if your application is only interested in a subset of services. If the watch-delay is too high you risk not getting an immediate update when the services changes and if it’s too low you get flooded with events.
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (8 by maintainers)

 Top Related Medium Post
Top Related Medium Post Top Related StackOverflow Question
Top Related StackOverflow Question
I think that is a rarity. As you mentioned, you can disable it and roll your own. We’ll wait to see if there are more folks who want this.
I need to implement the scenario in service1 where I want to know health of service2 and if it is up/running then will take action accordingly. I want to know the health of a service on a separate thread or basically in a non-blocking way. How do I implement it using catalog watch ? Is there any other way to implement as well ? Are there any examples available ?