You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project includes a MyRestClient interface with an annotated @CacheResult method with @CacheKey annotated parameters. In the GreetingResource, the cached method is called first, and then a second call is made using the Quarkus Cache programmic API, where I make a CompositeCacheKey that should match the @CacheKey annotated parameters.
A GreetingResourceTest is available, that verifies that the client REST endpoint is only called once, but the test fails because of the described bug.
Output of uname -a or ver
Linux codespaces-8fce81 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version "17.0.7" 2023-04-18 LTS OpenJDK Runtime Environment Microsoft-7626293 (build 17.0.7+7-LTS) OpenJDK 64-Bit Server VM Microsoft-7626293 (build 17.0.7+7-LTS, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.8.Final
Build tool (ie. output of mvnw --version or gradlew --version)
Gradle, see reproducer project
Additional information
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When a
@CacheResult
annotated interface method has@CacheKey
annotated parameters, Quarkus cache ignores the@CacheKey
annotation. For example:Expected behavior
@CacheKey
is respected.Actual behavior
@CacheKey
is ignored.cacheKeyParameterPositions
inCacheInterceptor.getCacheKey
is empty, thus resulting in the wrong cache key being generated.How to Reproduce?
I have made a reproducing project here https://github.com/AndreasPetersen/quarkus-cache-key-interface/tree/main.
The project includes a
MyRestClient
interface with an annotated@CacheResult
method with@CacheKey
annotated parameters. In theGreetingResource
, the cached method is called first, and then a second call is made using the Quarkus Cache programmic API, where I make aCompositeCacheKey
that should match the@CacheKey
annotated parameters.A
GreetingResourceTest
is available, that verifies that the client REST endpoint is only called once, but the test fails because of the described bug.Output of
uname -a
orver
Linux codespaces-8fce81 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.7" 2023-04-18 LTS OpenJDK Runtime Environment Microsoft-7626293 (build 17.0.7+7-LTS) OpenJDK 64-Bit Server VM Microsoft-7626293 (build 17.0.7+7-LTS, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.8.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle, see reproducer project
Additional information
No response
The text was updated successfully, but these errors were encountered: