crossoverJie / distributed-redis-tool

🔒A simple distributed tools based on Redis.
https://crossoverjie.top/tags/Distributed-Lock/
MIT License
613 stars 305 forks source link

关于Builder的入参问题 #19

Closed ilaotan closed 5 years ago

ilaotan commented 5 years ago

可否改为接口类 RedisConnectionFactory 这样我觉得springboot2下也能用了

编辑掉...刚才试了, lettuce的用法还是有区别的,看来无法跟springboot2各种兼容升级了,只能排除lettuce,还使用jedis

不过我感觉下面这个获取姿势可以用在Builder的构造方法上.

if (redisConnectionFactory instanceof JedisConnectionFactory) { final JedisConnectionFactory bean1 = (JedisConnectionFactory) redisConnectionFactory; if (bean1.isRedisClusterAware()) { this.type = RedisToolsConstant.CLUSTER; } else { this.type = RedisToolsConstant.SINGLE; } }

crossoverJie commented 5 years ago

有好的想法或者是建议可以提个 PR。

ilaotan commented 5 years ago

我错了调试时用的spring-data-redis 2.x ...isRedisClusterAware()方法是新加的. 在1.x里没有. 哎关了吧