-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support Providers in REST Client Reactive from context #32976
Conversation
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
@geoand please take a look into this pull request. Thanks! |
I'll have a look tomorrow |
In the meantime, please rebase onto |
Done |
🙏🏼 |
This comment has been minimized.
This comment has been minimized.
PR updated with adding javadocs to the request and response client filters. |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
This pull request adds a Providers implementation, so users can look up the Provider instances configured per REST Client Reactive.
In REST Client Classic, we can inject the
Providers
instance via injection (using@Context Providers provider
). Initially, I implemented this approach in REST Client Reactive too (including the request context propagation from the server to the client - necessary for the headers), plus using the@RequestScope
, and all the tests passed.However, I realized that some tests became flaky because sometimes the application context was null (I didn't find the root cause, but it's likely caused to switching from/to the request context).
Therefore, I took away from the injection approach and implemented this simplistic and straightforward approach: get the Providers instance from the context
context.getProviders()
(documentation updated).From my point of view, this approach makes more sense than the one in REST Client Classic and it does not over-complicate the injection mechanism in the REST Client Reactive for a little benefit.
Fix #26003