Is the redisson client thread-safe? In my application, I would like to maintain one client object and let all the threads use this to get/put to Redis. In the config, there are two parameters threads
and nettyThreads
. Do these parameters help create a connection pool? If yes, which among these should I use if my use-case is primarily simple get/put operations on Redisson objects?
Also, are these connections active throughout the life of the RedissonClient?
Redisson client and all of its objects are thread safe. threads
and nettyThreads
are configuration for the internal thread pools.
Since netty uses event loop model that is similar to the way Redis works internally, you don't need a great deal of threads. The default value is twice the number of your processor cores, assuming you have hyper-thread or equivalent technology enabled. I would advise to start on the default value and see how you are getting on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With