Search code examples
redisluaredisson

Decoder issue when executing lua script on redis through RedissonScript


I have a lua script -

if redis.call('EXISTS', KEYS[1]) == 1 then
    return 'A'
else
    return 'B'
end

When i try to execute this through RedissonScript

client.getScript().eval(RScript.Mode.READ_WRITE, luaScript, RScript.ReturnType.MULTI, Collections.singletonList("ABC"))

I get a "CommandDecoder - Unable to decode data. unsupported protocol version 66" error? I do not get an error when i try to return a boolean or integer value instead of a string.


Solution

  • You need to call client.getScript(StringCodec.INSTANCE).eval() method