【发布时间】:2022-01-04 19:08:07
【问题描述】:
我无法使用 redisson 读取 redis。一直报这个错误,
Execution exception[[RedisException: ERR Error running script (call to f_7b48e722af8a55315c5dd6c1028bf4652ad35c66):
@user_script:1: user_script:1: bad argument #2 to 'unpack' (data string too short). channel: [id: 0xdf273186, L:/127.0.0.1:62712 - R:/127.0.0.1:6379]
command: (EVAL), params: [local s = redis.call('hgetall', KEYS[1]); local result = {}; local maxSize = tonumber(redis.call('hg..., 5, ALLUS_XXX,
redisson__timeout__set:{ALLUS_XXX}, redisson__idle__set:{ALLUS_XXX}, redisson__map_cache__last_access__set:{ALLUS_XXX}, {ALLUS_XXX}:redisson_options, 1637953536277]]]
我能够使用 redisson 框架设置和获取值。但是当我使用 cli 设置时,就像
HMSET ALLUS_XXX 1 "{\"ev\":\"Q\",\"sym\":\"XXX\",\"bx\":\"1\",\"ax\":\"20\",\"bp\":157.2,\"ap\":157.21,\"bs\":5,\"as\":1,\"t\":\"1637949207844\",\"q\":\"60303179\",\"z\":3}"
现在尝试使用代码检索,
getMapCache("ALLUS_XXX").readAllEntrySet()
它会抛出上述错误。
【问题讨论】:
-
我也尝试过使用几个编解码器,
redisService.client.getMapCache(key, StringCodec.INSTANCE ).readAllEntrySet()和redisService.client.getMapCache(key, ByteArrayCodec.INSTANCE ).readAllEntrySet()