Jedis: Support of automated background topology refresh in cluster mode#3283
Jedis: Support of automated background topology refresh in cluster mode#3283agarwalbharat wants to merge 1 commit intospring-projects:mainfrom
Conversation
Jedis added support of topology refresh and providing a period on which jedis will refresh node topology of cluster. This was done from jedis version v5.1.0 https://github.com/redis/jedis/releases/tag/v5.1.0 In pr: redis/jedis#3596 Signed-off-by: Bharat Agarwal <agarwalbharat68@gmail.com>
baf6824 to
0fcea1e
Compare
|
|
|
That makes sense, @mp911de While we might not be using this property directly right now, we do maintain a topology outside of Jedis as well. That topology currently has a hard-coded cacheTimeout of 100 ms, so I was wondering whether it would make sense to reuse this value there too in case, so that Jedis and this topology provider remain in sync with time too. Given that |
Issue
Currently, when using
JedisConnectionFactoryfrom spring-data-redis, there is no support for configuring an automatic, periodic topology refresh for the Jedis client.This functionality was initially added only for Lettuce. At that time, Jedis did not provide a feature and interface to enable background, periodic topology refresh.
Issue: spring-projects/spring-boot#15630
Jedis has added support for automated background topology refresh, allowing users to configure a period at which Jedis refreshes the cluster node topology.
This was done from jedis v5.1.0:
Implementation details in pull request: redis/jedis#3596
Fix
Added support for configuring the topology refresh period duration in the
JedisClientConfigurationbuilder.By default, this value is set to null.
topologyRefreshPeriodin the configuration,nullis passed to the Jedis constructor (the default Jedis behavior). In this case, Jedis does not create or perform automatic background topology refresh.Example Code: Enabling Automated Topology Refresh with a Configured Period
Example Code: Disabling Automated Topology Refresh (Default/Existing Behavior)