quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.54k stars 2.61k forks source link

Configuration to safely ignore null values in redis-cache #42184

Open anadinema opened 1 month ago

anadinema commented 1 month ago

Description

As redis does not support caching null values, currently in the implementation of redis-cache a check is there to throw a exception if the value is null. However, there can be a configuration to safely ignore the null value instead of throwing exception or trying to store it.

Same was discussed in #39547, hence creating this issue to have a configuration parameter which can achieve this behavior of safely ignoring null values instead of trying to save it in cache or throwing exception.

Implementation ideas

A parameter like cacheInfo.ignoreNullValues before the block where the exception is thrown

quarkus-bot[bot] commented 1 month ago

/cc @Ladicek (redis), @cescoffier (redis), @gwenneg (cache), @machi1990 (redis), @radcortez (config)

anadinema commented 1 month ago

@cescoffier, I have tried to do the implementation, https://github.com/quarkusio/quarkus/pull/42189

Please check, and let me know.

cescoffier commented 1 week ago

Started a discussion about null value in cache: https://github.com/quarkusio/quarkus/discussions/42940