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

minor fix #1342

Merged
merged 4 commits into from
Mar 12, 2024
Merged

minor fix #1342

merged 4 commits into from
Mar 12, 2024

Conversation

wind57
Copy link
Contributor

@wind57 wind57 commented Mar 2, 2024

No description provided.

@@ -14,7 +14,13 @@ TIP: It is possible to disable Spring Cloud LoadBalancer by setting the value of

Spring Cloud LoadBalancer creates a separate Spring child context for each service id. By default, these contexts are initialised lazily, whenever the first request for a service id is being load-balanced.

You can choose to load those contexts eagerly. In order to do that, specify the service ids for which you want to do eager load using the `spring.cloud-loadbalancer.eager-load.clients` property.
You can choose to load those contexts eagerly. In order to do that, specify the service ids for which you want to do eager load using the `spring.cloud-loadbalancer.eager-load.clients` property, for example:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was writing some integration tests for spring-cloud-kubernetes (where I work most) and in one of them, I wanted to eager init load balancer. The documentation here was not clear enough for me that this property is actually an array of elements. imho, adding such a small example makes it clear.

@wind57 wind57 marked this pull request as ready for review March 2, 2024 08:14
@wind57
Copy link
Contributor Author

wind57 commented Mar 2, 2024

while this might be a little beneficial, the only reason I wanted to do eager initialization, is because I don't know how to retrieve the ServiceInstanceListSupplier that is created lazily. In other words: how do I retrieve the ServiceInstanceListSupplier at runtime, after the first call to load balancer. I tried things like getBeansOfType(ServiceInstanceListSupplier.class) or using ObjectProvider, but none worked.

In case you think this should be a separate question, just let me know...

@@ -14,7 +14,13 @@ TIP: It is possible to disable Spring Cloud LoadBalancer by setting the value of

Spring Cloud LoadBalancer creates a separate Spring child context for each service id. By default, these contexts are initialised lazily, whenever the first request for a service id is being load-balanced.

You can choose to load those contexts eagerly. In order to do that, specify the service ids for which you want to do eager load using the `spring.cloud-loadbalancer.eager-load.clients` property.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a typo here, too:

spring.cloud-loadbalancer.eager-load.clients

vs

spring.cloud.loadbalancer.eager-load.clients

@ryanjbaxter ryanjbaxter added this to the 4.1.2 milestone Mar 12, 2024
@ryanjbaxter ryanjbaxter merged commit 6400b54 into spring-cloud:main Mar 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants