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

Support Providers in REST Client Reactive from context #32976

Merged
merged 1 commit into from
May 11, 2023

Conversation

Sgitario
Copy link
Contributor

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

@github-actions
Copy link

github-actions bot commented Apr 28, 2023

🙈 The PR is closed and the preview is expired.

@quarkus-bot

This comment has been minimized.

@Sgitario
Copy link
Contributor Author

@geoand please take a look into this pull request. Thanks!

@geoand
Copy link
Contributor

geoand commented May 10, 2023

I'll have a look tomorrow

@geoand
Copy link
Contributor

geoand commented May 10, 2023

In the meantime, please rebase onto main so we don't run into any nasty surprises

@Sgitario
Copy link
Contributor Author

In the meantime, please rebase onto main so we don't run into any nasty surprises

Done

@geoand
Copy link
Contributor

geoand commented May 10, 2023

🙏🏼

@quarkus-bot

This comment has been minimized.

@Sgitario
Copy link
Contributor Author

PR updated with adding javadocs to the request and response client filters.

@Sgitario Sgitario added the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 11, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented May 11, 2023

✔️ 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.

@Sgitario Sgitario merged commit d4cac96 into quarkusio:main May 11, 2023
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 11, 2023
@Sgitario Sgitario deleted the 26003 branch May 11, 2023 11:17
@quarkus-bot quarkus-bot bot added this to the 3.1 - main milestone May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rest-client-reactive does not inject Providers in ClientRequestFilter
2 participants