Support custom NullValueSerializer
in GenericJackson2JsonRedisSerializer
#2878
Labels
status: ideal-for-contribution
An issue that a contributor can help us with
type: enhancement
A general enhancement
Milestone
If one wants a custom NullValueSerializer you can define your own
registerNullValueSerializer
, you cannot define your ownNullValueSerializer
but because
registerNullValueSerializer
is static, you have to also overwrite other methods like the base constructors.so how can one easily define their own nullValueSerializer?
the use case in particular i am using it as redis is used as the backend for
@cachable
and i want to cache the fact that i have a null value for some keys. the default null that the redis serializer uses isjsonGenerator.writeStringField(classIdentifier, NullValue.class.getName());
, which produces a weird byte array that when i try to deserialize it (access the cache later) it gives me an error.And then semi-related, if i overwrite the
deserialize
method to return null if i see the special null identifier,@cacheable
considers it a cache miss. but i actually really do want to return the value null from my cache!!The text was updated successfully, but these errors were encountered: