I have a problem with… I develop a component which using redis client Lettuce.The code is
package tigase.mucon.redis; import io.lettuce.core.RedisURI; import io.lettuce.core.cluster.RedisClusterClient; import io.lettuce.core.cluster.api.StatefulRedisClusterConnection; import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands; import tigase.kernel.beans.Bean; import tigase.kernel.beans.Inject; import tigase.kernel.beans.config.ConfigField; import tigase.mucon.MujiComponent; import tigase.mucon.bean.ConferenceInfo; import tigase.xmpp.jid.JID; import java.util.ArrayList; import java.util.UUID; @Bean(name = "redis-config", parent = MujiComponent.class, active = true) public class RedisConfig { private ArrayList<RedisURI> list = new ArrayList<RedisURI>(); @ConfigField(desc = "Redis hosts,split by ,", alias = "redis-hosts") protected String redisHosts = "redis://127.0.0.1:7001,redis://127.0.0.2:7001,redis://127.0.0.3:7001"; @Inject private MujiComponent mujiComponent; private RedisClusterClient client; private StatefulRedisClusterConnection<String, String> connect; public RedisConfig() { String[] redisHosts = this.redisHosts.split(","); for(String redisHost : redisHosts){ list.add(RedisURI.create(redisHost)); } System.out.println(this.redisHosts); } public RedisClusterClient getClient() { return client; } }
and the config.tdsl is
muji (class: tigase.mucon.MujiComponent) { 'cache-middleware' = 'redis' 'redis-config' (class: tigase.mucon.redis.RedisConfig) { 'redis-hosts' = 'redis://10.64.3.21:7001,redis://10.64.3.22:7001,redis://10.64.3.23:7001' } }
How to make the 'System.out.println(this.redisHosts);' print 'redis://10.64.3.21:7001,redis://10.64.3.22:7001,redis://10.64.3.23:7001' not 'redis://127.0.0.1:7001,redis://127.0.0.2:7001,redis://127.0.0.3:7001' in contructor of class RedisConfig.Or how to initialization the value RedisClusterClient client;
Details (please complete the following information):
I find that in development guide in 1.7.8,thanks
I have a problem with… I develop a component which using redis client Lettuce.The code is
and the config.tdsl is
How to make the 'System.out.println(this.redisHosts);' print 'redis://10.64.3.21:7001,redis://10.64.3.22:7001,redis://10.64.3.23:7001' not 'redis://127.0.0.1:7001,redis://127.0.0.2:7001,redis://127.0.0.3:7001' in contructor of class RedisConfig.Or how to initialization the value RedisClusterClient client;
Details (please complete the following information):