-
Notifications
You must be signed in to change notification settings - Fork 701
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
Make use of a request factory for filter/interceptor #732
base: main
Are you sure you want to change the base?
Conversation
@andaziar Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@andaziar Thank you for signing the Contributor License Agreement! |
Thanks, but we've already started work on this in #714 |
@spencergibb this PR was (is) related to the discussion in #672 -- it's not obvious to me how the referenced PR solved the issue of extracting a |
The line I linked to has a create request method that can be implemented. Anyway, I think it's too early to consider something like this until #672 is done. I can reopen and put it on hold. |
Thanks for the quick response. Our purpose was to inject the strategy in the Either way - as mentioned in #672 - we can find a way to work around this in our own code, but it would be much better if our work-around was somewhat aligned to your future design :) |
Sure. We can revisit after #672. |
The build fails BTW
|
Hi and thank you for the quick replies @spencergibb . I'll fix the compile errors in this PR. Apologies for that. Sloppiness on my end. And for clarifying regarding intent of this PR; it's a suggestion to showcase how one could extract the loadbalancer hint from the incoming request while also giving developers the power to do so as they see fit e.g. checking a header called |
This PR involves creating a request factory that will be used to convert incoming HTTP requests from ReactorLoadBalancerExchangeFilterFunction/LoadBalancerInterceptor to
org.springframework.cloud.client.loadbalancer.reactive.Request
.RequestFactory
has one method that allows developers to plug in their own implementation for doing the conversionClientRequest -> Request<?>
orHttpRequest -> Request<?>
or any other request object for that matter. It also contains default implementations that represents the default strategy of checking theloadBalancerHint
.