using ByteArrayCodec.INSTANCE
in RedissonBasedProxyManager
#460
-
Hi! Upon testing the behavior of Bucket4j with Redisson, I discovered that // io.github.bucket4j.redis.redisson.cas.RedissonBasedProxyManager.java;
RFuture<Boolean> redissonFuture = commandExecutor.writeAsync(stringKey, ByteArrayCodec.INSTANCE, SET, stringKey, encodeByteArray(newData), "NX"); If my understanding is correct, the codec used here should match the codec configured in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @Jaysok
Wrapping-out byte array by quotas will not make it more readable, it will stay be array of bytes.
No. Redisson API explicitly allows you to choose codec that is more performant/suitable for each particular case. If you want to read stored data, you shoud to learn serialization/deserialization routine https://github.com/bucket4j/bucket4j/blob/8.9/bucket4j-core/src/main/java/io/github/bucket4j/distributed/remote/RemoteBucketState.java#L51 |
Beta Was this translation helpful? Give feedback.
Hello @Jaysok
Wrapping-out byte array by quotas will not make it more readable, it will stay be array of bytes.
No. Redisson API explicitly allows you to choose codec that is more performant/suitable for each particular case.
If you want to read stored data, you shoud to learn serialization/deserialization routine https://github.com/bucket4j/bucket4j/blob/8.9/bucket4j-core/src/main/java/io/github/bucket4j/distributed/remote/RemoteBucketState.java#L51