我有一个场景,我需要使用的数据结构是一个Map<String,Map<String,List<String>>。
我想使用Redis将这些数据存储在内存缓存中。
我感兴趣的一件事是,使子映射的“键”(在本例中是Map<String,List<String>>)在5分钟后到期。
我在Redis (Redisson实现)中尝试过这样的方法,
RMap<String,Map<String,List<String>> parentMap = redisson.getMap("parentMap");
RMapCache<String,List<String>> childCache = redisson.getMapCache("childMapCache");
childCache.put("test",new ArrayList<String>(),5,TimeUnit.Minutes);
//Placing the child cache into parent map
parentMap.put("child",childCache);但是当我这样做的时候,我得到了下面的错误消息(去掉了根本原因)
"unnotified cause: io.netty.handler.codec.EncoderException:
java.io.NotSerializableException: org.redisson.RedissonReference"有办法把这样的数据结构放到Redis里吗?
发布于 2017-06-21 19:04:22
当使用了Java序列化或类似的编解码器时,就会发生此错误,现在已经在2.9.3和3.4.3中修复了这个错误。
https://stackoverflow.com/questions/43903210
复制相似问题