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

Guard the bootstrap of CompositeDiscoveryClientAutoConfiguration with property

Open mipo256 opened this issue 1 month ago • 1 comments

Currently, whether you like it or not, the CompositeDiscoveryClientAutoConfiguration will create the CompositeDiscoveryClient, which in general is fine, but sometimes it is not. In our case, for instance, we want to use our own DiscoveryClient directly, we cannot really use the CompositeDiscoveryClient for various reasons.

So, that would be nice if there would be at least some ways to configure this behavior. For instance, to preserve backward behavioral compatibility by default CompositeDiscoveryClient is created, but some property would allow to omit the creation of CompositeDiscoveryClient bean.

mipo256 avatar Nov 15 '25 12:11 mipo256

P.S: we ended-up doing stuff like @EnableAutoConfiguration(exclude = CompositeDiscoveryClientAutoConfiguration.class). Maybe, this can be viewed as a solution as well.

mipo256 avatar Nov 15 '25 12:11 mipo256