-
Notifications
You must be signed in to change notification settings - Fork 189
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
Caffeine time based eviction policy does not work in native mode #6224
Comments
It may be related how you set the cache key header. Instead of:
Try:
|
@jamesnetherton Ready I managed to solve, now I am enabling the elimination of the cache after a certain time, but I cannot eliminate it, that is, use the properties camel.component.caffeine-cache.expire-after-access-time and camel.component.caffeine-cache .expire-after-write-time, however, I am testing and after setting a time to 60 seconds, the query is still being done in the cache:
Test number 1 at 2:00 PM Query the cache: CamelCaffeineActionHasResult =true Test number 2 at 2:04 PM, in this chaos 240 seconds have already passed since it was cached: Keep consulting the cache: CamelCaffeineActionHasResult =true What could be the cause of this behavior? Shouldn't it be possible to consult the service again outside the cache after the expiration time (60sec)? This is how I ended up configuring my ResRoute
|
You need to set:
Otherwise Also: |
Thank you so much @jamesnetherton Everything works great for me locally, but I have the following problem once I do the native compilation, what could be happening?
I attach my pom.xml
ResRoute
application.properties
That could be happening? |
To work around the problem, try adding a configuration property like:
|
This will get fixed permanently in Quarkus 3.13.0 (maybe 3.12.1). |
@jamesnetherton Thank you very much, in the end I had to add the annotation with 2 values:
|
Good morning
I am currently working with camel in quarkus and I want to implement cache when making calls to other APIs, however, I have doubts when implementing it in my ResRoute classes:
Class ResRoute
In this part he called one of the microservices:
In the FindIndividualCustomerByDocIdProcessorReq class I create the Request for the call:
The request that is created is like the following:
If I have 2 fields that must be mandatory (documentType and documentNumber), would it be a key with both fields or can it be just one?
In the FindIndividualCustomerByDocIdProcessorRes class I create the Response for the service response:
My question is how can I edit my code to add cache to my calls?
I tried the following way, but it gives me an error code http 500:
The error it gives me is the following, it seems to me that it is not correctly taking the value of the key:
Failed delivery for (MessageId: 1089E8B0FF423A6-0000000000000000 on ExchangeId: 1089E8B0FF423A6-0000000000000000). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExchangeException: No value provided in header or as default value (CamelCaffeineKey). Exchange[1089E8B0FF423A6-0000000000000000]
Thanks for the support in advance
The text was updated successfully, but these errors were encountered: