0

I successfully did insert values to my redis cache and when trying to get the values that is stored, I am getting values like

127.0.0.1:6379> HGETALL UPGRADE_ME
1) "\xfc\r-447340129694"
2) "\x00\x00\x00\x00\x00\x00\x00\x00S\x00\x00\x00\x00\x00\x00\x00\x00\x010com.customer.upgrade.Key\x00\xfd\x00\x00\x00\x00\x00\xd0\xbe@\xff\x00\x10\x00\xff\xfc\x04time\xff\xff\xfc\x06reason\x00"

Are the values getting stored as binary? Also how can I make it store as json.?

My java code looks like

    RMapCache<String, Key> keys= redissonClient.getMapCache(UPGRADE_ME);
    keys.put(key1, obj, cacheProperties.getProps(),
                TimeUnit.SECONDS);
JITHIN_PATHROSE
  • 1,134
  • 4
  • 14
  • 29

1 Answers1

0

There are APIs to pass the codec and we can pass org.redisson.codec.JsonJacksonCodec() for storing objects as json

 RMapCache<String, Key> keys= redissonClient.getMapCache(UPGRADE_ME,new org.redisson.codec.JsonJacksonCodec());
 keys.put(key1, obj, cacheProperties.getProps(),
            TimeUnit.SECONDS);
JITHIN_PATHROSE
  • 1,134
  • 4
  • 14
  • 29