<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="${redis.jedisPoolConfig.maxTotal}" /> <property name="maxIdle" value="${redis.jedisPoolConfig.maxIdle}" /> <property name="minIdle" value="${redis.jedisPoolConfig.minIdle}" /> <property name="maxWaitMillis" value="30001" /> <property name="testOnBorrow" value="true" /> <property name="testOnReturn" value="true" /> <property name="testWhileIdle" value="true" /> </bean> <!-- 集群方式分片 --> <bean id="jedisCluster" class="redis.clients.jedis.JedisCluster"> <constructor-arg index="0"> <set> <bean id="hostAndPort0" class="redis.clients.jedis.HostAndPort"> <constructor-arg index="0" value="${redis.jedisCluster.host}"></constructor-arg > <constructor-arg index="1" value="${redis.jedisCluster.port}" ></constructor-arg> </bean> </set> </constructor-arg> <constructor-arg index="1" ref="jedisPoolConfig" ></constructor-arg> </bean> <bean id="redisJedisClient" class="com.redis.b2c.common.utils.RedisJedisClient" lazy-init="false"> <property name="jedisCluster" ref="jedisCluster"></property> </bean>