-
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
RESTEasy Reactive doesn't apply ContainerRequestFilter
s to reactive methods
#27979
Comments
Interesting case. Could you attach a sample application we could use to test fixes against? |
Here's one for both Java/Mutiny and Kotlin coroutine. The reproducer was needed, apparently it requires the JAX-RS annotations to be on an API interface with the name binding filter on a resource implementation class. |
Thanks. I'll have a look next week. |
This happens because the name binding annotation is declared on the interface. I am not 100% sure we should support this |
It's not on the interface, it's on the implementation. The JAX-RS annotations are on the interface. This use case is pretty useful and I believe supported by the JAX-RS specification. We generate our JAX-RS interfaces and then need to apply certain annotation to the implementation. |
Not to mention, it does work... just only for |
Then I must have lost track of the changes I need to see it working. Let me check again |
This does not appear to be true, at least not with https://github.com/quarkusio/quarkus/files/9581532/code-with-quarkus.zip |
The fix does not seem to break any of the TCK tests, so let's go ahead and add it. |
Take @namebinding in the class hierarchy into account
Fixes: quarkusio#27979 (cherry picked from commit 66b59c4)
Describe the bug
When applying a name bound
ContainerRequestFilter
to a resource that has only reactive methods (in the discovery case they were Kotlinsuspend
methods) the filter is never called.The filter is not applied even if the name binding annotation is explicitly applied to the method or if the annotation is applied to the class as a whole.
The filter did not do anything that made it blocking; not that it mattered since it was never called.
After changing the filter to implement
ResteasyReactiveContainerRequestFilter
the filter was called as expected.Expected behavior
ContainerRequestFilter
s are applied to reactive methods.Alternatively, some appropriate error should be generated to relay that
ResteasyReactiveContainerRequestFilter
must be implemented.Actual behavior
Filters must implement
ResteasyReactiveContainerRequestFilter
for them to be called for reactive methods.Also, interestingly they are also applied to server methods even if you accidentally implement the client version
ResteasyReactiveClientRequestFilter
; which I found out because that's what I initially did.How to Reproduce?
Create NameBinding Filter
Apply Filter to a reactive resource
Output of
uname -a
orver
macOS 12.6
Output of
java -version
OpenJDK 17.0.1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.12.0.Final & 2.13.0.CR1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.5.1
Additional information
No response
The text was updated successfully, but these errors were encountered: