在spring-data-redis中定义集群节点属性的替代方法(Alternative way to define cluster nodes property in spring-data-redis)
我试图在我的项目中使用spring-data-redis。 当我在yaml文件中配置redis节点时:
spring: redis: cluster: max-redirects: 2 nodes: host1:6379,host1:6380,host1:6381
然后,spring-data-redis在内部为集群创建JedisConnectionFactory。 但是,如果我尝试按以下方式配置:
spring: redis: cluster: max-redirects: 2 nodes: - host1:6379 - host1:6380 - host1:6381
然后,我必须在我的应用程序中为集群创建JedisConnectionFactory的bean。
我猜当前版本的spring-data-redis不支持在yaml中以数组方式表示节点数以创建集群。
我的建议是spring-boot / spring-data-redis开发人员支持上面的yaml格式来内部创建redis集群吗?
I was trying to use spring-data-redis in my project. When I configure redis nodes in yaml file like:
spring: redis: cluster: max-redirects: 2 nodes: host1:6379,host1:6380,host1:6381
Then, spring-data-redis creates the JedisConnectionFactory for cluster internally. But If I try to configure by following ways:
spring: redis: cluster: max-redirects: 2 nodes: - host1:6379 - host1:6380 - host1:6381
Then, I must have to create the bean of JedisConnectionFactory for cluster in my application.
I guess current version of spring-data-redis not supporting representation of number of nodes in array way in yaml to create cluster.
My suggestion is can spring-boot/spring-data-redis developer supports above format of yaml to create redis cluster internally?