Caused by: io.lettuce.core.RedisException: java.lang.IllegalStateException
Caused by: io.lettuce.core.RedisException: java.lang.IllegalStateException记录一个redis使用过程中出现的一个异常org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core
Caused by: io.lettuce.core.RedisException: java.lang.IllegalStateException
记录一个redis使用过程中出现的一个异常
org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.lang.IllegalStateException
原因是:在使用lua脚本完成redis的获取token与删除token,使其为一个原子操作
String script = "if redis.call('get',KEYS[1]) == ARGV[1] then return redis.call('del',KEYS[1]) else return 0 end";
Long executeResult = stringRedisTemplate.execute(new DefaultRedisScript<>(script, Long.class),…)
接收的返回值应该是Long类型的,我原来写成Integer类型,所以报了这个错。
更多推荐
所有评论(0)