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
load balancing - get(Request request) should be called on delegates #1227
Comments
Potential/proposed fix in 16ecfa1 |
I need this too. When and which branch will it be merged into? |
Thanks for reporting the issue @thewmo. Will discuss this with the team and get back to you. |
We agree that this makes sense. I will be marking at as an enhancement. We should update all the suppliers accordingly. The plan would be to make it |
I have a load balancing configuration that combines zone awareness with a method that need access to the request context/headers (sticky session):
The comments make clear the desired logic - I want same-zone routing, unless the sc-lb-instance-id cookie specifies the ID of an instance in a different zone. Consequently withZonePreference() is specified after request based sticky session. Otherwise it will only ever be possible to "stick" to an instance in the same zone.
However, in debugging this, it appears the ZonePreferenceServiceInstanceListSupplier is only implementing the get() method that does not take a request, and consequently the request is not propagated to the downstream delegate (in this case, the sticky session mechanism). It seems the ZonePreferenceServiceInstanceListSupplier should also implement
Flux<List<ServiceInstance>> get(Request request)
and propagate the request to the delegate.spring-cloud-commons/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/ZonePreferenceServiceInstanceListSupplier.java
Line 53 in 51ee785
While the documentation does not show any examples of combining ServiceInstanceListSuppliers like this, nothing I found in the docs suggest the list suppliers were not intended to be composable in this way.
The text was updated successfully, but these errors were encountered: