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

Introduce versions of ClientRequestFilter and ClientResponseFilter that can suspend and resume #16615

Closed
geoand opened this issue Apr 19, 2021 · 13 comments · Fixed by #16624
Closed
Assignees
Labels
area/rest kind/enhancement New feature or request
Milestone

Comments

@geoand
Copy link
Contributor

geoand commented Apr 19, 2021

Description

In RESTEasy Reactive we have the ResteasyReactiveContainerRequestFilter and ResteasyReactiveContainerResponseFilter which can suspend and resume thus allowing for non-blocking filters.

We should have something similar for the client

Originally came up in #16523

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 19, 2021

/cc @FroMage, @stuartwdouglas

@geoand geoand changed the title Introduce @ClientRequestFilter and @ClientResponseFilter Introduce versions of ClientRequestFilter and ClientResponseFilter that can suspend and resume Apr 19, 2021
@FroMage
Copy link
Member

FroMage commented Apr 19, 2021

Well OK, but then also exception mappers, no? ;)

@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

Yup

@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

But probably later, cause I don't know if/how are handling the exception mapper for the client

@FroMage
Copy link
Member

FroMage commented Apr 19, 2021

Sure, those are not linked.

@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

I opened a new issue: #16626

@FroMage
Copy link
Member

FroMage commented Apr 19, 2021

Damnit, man, I'm sorry I misread this issue. I thought you were talking about annotation-declared client requests and filters, and I suggested adding annotation-declared exception mappers. I didn't realise I had mis-read the subject. I don't think exception mappers can suspend on the server-side, can they?

@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

No need to apologize, you likely read the correct thing :)
What happened is that when I opened the issue initially, I did mention the annotations. Howeve then I realised that the client doesn't automatically register filters, so I then changed the title and description to only mention suspend and resume.

As for exception mappers, they can resume on server

@FroMage
Copy link
Member

FroMage commented Apr 19, 2021

Hahahaha, excellent :)

@FroMage
Copy link
Member

FroMage commented Apr 19, 2021

However then I realised that the client doesn't automatically register filters

Huh, is that by design or because we forgot?

@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

I think it's just how the JAX-RS client works by spec - if it worked otherwise, the TCK would have a ton of failing tests :)

geoand added a commit that referenced this issue Apr 19, 2021
Introduce the ability to create client filters that suspend and resume
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 19, 2021
@FroMage
Copy link
Member

FroMage commented Apr 19, 2021

I think it's just how the JAX-RS client works by spec - if it worked otherwise, the TCK would have a ton of failing tests :)

OK, but is it what we think is the right thing to do?

I mean, programmatically supporting them is one thing, and we do ATM. But why limit it this way?

https://quarkus.io/specs/jaxrs/2.1/index.html#binding_in_client_api says:

Binding in the Client API is accomplished via API calls instead of annotations. Client, Invocation, Invocation.Builder and WebTarget are all configurable types: their configuration can be accessed using the methods inherited from the Configurable interface. See Configurable Types for more information.

So, IMO we can make a good case for supporting, in addition to the spec, globally registered client filters by adding @Provider on them, or with new annotations like @ClientRequestFilter

@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

Yeah, I like the idea.
Up until today I actually thought that the filters where automatically registered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants