Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Return the combination of ServiceInstances in CompositeDiscoveryClients #1190

Open
driesdeproost opened this issue Jan 9, 2023 · 2 comments

Comments

@driesdeproost
Copy link

driesdeproost commented Jan 9, 2023

Currently the ReactiveCompositeDiscoveryClient returns the first non-empty Flux of ServiceInstances when invoking its getInstances() method.
When you use multiple DiscoveryClients and you want to balance traffic over them (e.g. a weighted load balancing strategy towards multiple cloud environments), you will have to disable the spring.cloud.discovery.reactive.enabled and provide your own implementation that replaces the existing ReactiveCompositeDiscoveryClient. Disabling this property also has some impact on other conditionals, such as in KubernetesInformerReactiveDiscoveryClientAutoConfiguration for example

This is manageable, but it feels like returning combined results of DiscoveryClients instead of returning the first non empty flux would often make more sense.

Would it be possible to add a property to switch the behaviour of the ReactiveCompositeDiscoveryClient so that results from DiscoveryClients are combined? (and perhaps also for the non reactive variant CompositeDiscoveryClient)

@OlgaMaciaszek
Copy link
Collaborator

@driesdeproost Thanks for creating this issue. Makes sense to me. Will discuss this with the team.

@OlgaMaciaszek
Copy link
Collaborator

Will have to be opt-in. Also possible consideration: adding info on which DiscoveryClient a SI came from to metadata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants