-
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
@Cache annotation not honored on reactive REST resource beans with separate interface #39002
Comments
/cc @geoand |
The first sample project was actually missing the @Cache annotation on the implementation. I added it (but of course, the test still fails) |
Looks to me like that could be solved by taking the "actualEndpointInfo" into account in "CacheControlScanner", like it is done in "EndpointIndexer", line 719ff, to allow implementing methods to override the "blocking" and "runOnVirtualThread" info of the endpoint method. |
Makes sense to me. Would you like to implement this fix as you have already analyzed the code? |
Yes, I can try to provide a PR. Just one question:
Can you very briefly point me to an explanation of the difference? In my tests, they seem to return the same thing, so I am unsure which one I should use and why. |
And yet another question regarding the current implementation of CacheControlScanner: It first checks for |
|
You are right. If you want you can fix this behavior, but please do it in a separate PR |
Describe the bug
The org.jboss.resteasy.reactive.Cache annotation is only honored, if it is put on a JaxRS bean or a JaxRS interface itself.
If put on a bean that implements a JaxRS interface, the annotation is ignored.
Reasoning: We have lots of services where the JaxRS interfaces are generated from OpenAPI specification. We provide beans that implement these interfaces and Quarkus. We would like to add @Cache annotations to some of the implemented methods to control generated "Cache-Control" headers. But the annotation is ignored.
We cannot put the annotation of the JaxRS interface itself, because that is generated from an OpenAPI spec.
Expected behavior
When putting a @Cache annotation on a bean method that implements a JaxRS interface, the appropriate "Cache-Control" header should be generated.
Actual behavior
@Cache annotation is only honored when put on the JaxRS interface itself.
How to Reproduce?
See attached maven project with failing unit test.
Output of
uname -a
orver
Mac OS 14 (on MacBook Pro M1)
Output of
java -version
openjdk version "17.0.2"
Quarkus version or git rev
3.7.4
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn 3.9.6
Additional information
resteasy-reactive-cache.zip
The text was updated successfully, but these errors were encountered: