Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Lettuce RedisCodec For Numbers

$
0
0

Using Lettuce 5 as a Redis client for the first time - I'm finding it rather confusing to simply create a RedisCommands<String, Long> for getting/setting Redis values as a Long. It's a little unclear to me how I can accomplish this. From what I gather, the simplest way is to use the RedisClient overloaded constructor which takes a RedisCodec and RedisURI, but it seems I also need to implement the codec decoding/encoding methods? Since storing numbers is a fairly common use case with Redis, I find this approach rather bloated and I'm suprised there is no predefined codec for integer/long. Given this, I suspect there may be a simpler alternative that I have not come across. Is there an alternate approach?


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>