redis.clients.jedis.JedisShardInfo 类中的shards是个一list,为什么放入的bean就只要最后一个生效
解决方案 »
- The application has unexpectedly quit
- 请教一个关于spring中WebApplicationContext的问题
- 一个无状态会话bean可不可以从普通java类继承?抽象java类呢?
- 搞得我好乱啊!!!
- 在网页中如何查看不同格式的文件?
- [急]如何用JAVA写出一个站内搜索
- struts连数据库奇怪问题
- 什么是框架?越详细越好
- tomcat5.5一定要jdk1.5才能运行吗》?
- 各位java高手,能否提供关于ejb开发的实例及说明,谢谢
- 懒加载JDBC Connection will not be managed by Spring
- Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependenc
public static void setUpBeforeClass() throws Exception {
List<JedisShardInfo> shards = Arrays.asList(
new JedisShardInfo("localhost",6379),
new JedisShardInfo("localhost",6379)); //使用相同的ip:port,仅作测试
jedis = new Jedis("localhost");
sharding = new ShardedJedis(shards);
pool = new ShardedJedisPool(new JedisPoolConfig(), shards);
}
https://blog.csdn.net/s296850101/article/details/52416043