Open AndreasPetersen opened 1 year ago
/cc @gwenneg (cache)
For our testing and production environments, we want to run Redis, but for most local development and
@QuarkusTest
, we want to use the Caffiene backend, as this makes setup much easier.
There's already quarkus.cache.type that could be used to use caffeine
(default) or redis
(if quarkus-redis-cache
is present).
However, the Redis Cache guide does not mention this property at all?
CC @cescoffier @geoand
The property is set automatically IIRC
The property is set automatically IIRC
Do you happen to remember where? I did not see this pattern in other extensions. And even if we somehow set it by default if the quarkus-redis-cache
extension is present, we should probably also mention this in the docs.
It was originally:
@BuildStep
RunTimeConfigurationDefaultBuildItem redisCacheByDefault() {
return new RunTimeConfigurationDefaultBuildItem("quarkus.cache.type", "redis");
}
but was changed to use the properties file
Uf, I didn't know this is even possible and TBH I don't find it very transparent for users (provided it's not documented)...
BTW https://quarkus.io/guides/cache#configuring-the-underlying-caching-provider does not metion quarkus.cache.type
either. It does mention quarkus.cache.enabled
though.
We should definitely document it
Hi. It would also be awesome to configure it per cache-name. The situation we face is that we use a redis cache, but also would like to use the caffeine cache in parallel. We use the redis cache for caching some partner system responses, but in the caffeine cache we want to cache the OIDC token from a pod injected via a kubernetes BoundedServiceAccountVolume
. It does not really make much sense to cache it in redis.
Edit: Additional information. We also have a use-case where we cache data, which we cannot serialize. We need to use a custom caching solution now, because Jackson otherwise fails during serialization. In this situation it would also be helpful to select the caching backend per cache-name.
Description
With the introduction of Redis as a backend for Quarkus Cache, it would be great with a config property to choose the backend used, just like we can easily configure which database to use.
For our testing and production environments, we want to run Redis, but for most local development and
@QuarkusTest
, we want to use the Caffiene backend, as this makes setup much easier.I realize that Quarkus has a dev service for Redis, but my company uses computers that can't easily run Docker on them, so this is not really an option for us...
Implementation ideas
A new config property to select the backend for Quarkus Cache, for examle: