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?
↧
Lettuce RedisCodec For Numbers
↧