redisson / jvm serialization issue

96 views Asked by At

We started to observe some weird behaviour in a spring boot application that is using redisson.

There is a redisson map, where entities are being added and read. In some cases after reading an entity from the map it is deserialized incorrectly - it contains a wrong type in a field.

The given field (sourceDescription) is actually defined as string but we are seeing an UUID in there. Attaching a screenshot from the debugger.:

enter image description here

The field in the Alarm object is a String:

@JsonAlias({"sourceDescription", "source_description"})
private String sourceDescription;

Reading from the map is a one-liner:

final RMap<UUID, List<Alarm>> map = redisson.getMap(ALARM_QUEUE);

Adding is straigt forward as well

final List<Alarm> queuedAlarms = new ArrayList<>(map.get(key));
queuedAlarms.add(alarm);
map.put(key, queuedAlarms);

How is that even possible that the JVM allows a wrong type in a field?

0

There are 0 answers