spring-data-redis icon indicating copy to clipboard operation
spring-data-redis copied to clipboard

how to set jedis blockingSocketTimeoutMillis?

Open yunduankaifa opened this issue 2 years ago • 3 comments

in our project, we need to use lua script, but the default timeoutmillis is 0, which means to block forever; image Question : how to set blockingSocketTimeoutMillis in spring-data-redis?

yunduankaifa avatar Oct 16 '23 08:10 yunduankaifa

There's no mechanism to alter DefaultJedisClientConfig (implementing JedisClientConfig).

JedisClientConfig carries a lot of per-connection details such as the database or authentication credentials that conflict with Spring Data Redis' RedisConfiguration types that define authentication and database details.

Out of curiosity, why don't you use the Lettuce driver that has a configuration of TimeoutSource to supply timeouts on a per-command basis where you could define a timeout specific to your Lua command?

mp911de avatar Oct 16 '23 08:10 mp911de

There's no mechanism to alter DefaultJedisClientConfig (implementing JedisClientConfig).

JedisClientConfig carries a lot of per-connection details such as the database or authentication credentials that conflict with Spring Data Redis' RedisConfiguration types that define authentication and database details.

Out of curiosity, why don't you use the Lettuce driver that has a configuration of TimeoutSource to supply timeouts on a per-command basis where you could define a timeout specific to your Lua command?

since the issue (https://github.com/lettuce-io/lettuce-core/issues/2082) of lettuce has not been well solved, to be on the safe side, we choose jedis

yunduankaifa avatar Oct 16 '23 13:10 yunduankaifa

Mechanism to customize JedisClientConfig is also required to provide custom credentialsProvider required for implementing cloud identity based authentication.

tjuchniewicz avatar Mar 18 '24 19:03 tjuchniewicz