79460008

Date: 2025-02-22 17:39:51
Score: 1.5
Natty:
Report link

I had the same requirement to use HEXPIRE to set ttl for fields. As spring data redis, doesn't have any methods as of now, I have implemented the below code to run the command :

redisTemplate.execute((RedisCallback<Object>)connection ->connection.execute("HEXPIRE", ...args)

This worked a bit, this was storing cache in hash with ttl per field, but this was raising exception post setting the TTL like : ByteArrayOutput doens't not support set(long) , so to make it work temporarily I caught the exception and ignored it.

I know it's not good like this... :(

let me know if you found any solution..

Reasons:
  • Blacklisted phrase (1.5): any solution
  • Blacklisted phrase (1): :(
  • Whitelisted phrase (-1): I had the same
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Sricharan