<?xml version= "1.0" encoding= "UTF-8"? ><beans xmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:p= "http://www.springframework.org/schema/p"Xmlns:context= "Http://www.springframework.org/schema/context"Xmlns:jee= "Http://www.springframework.org/schema/jee" xmlns:tx= "Http://www.springframework.org/schema/tx"XMLNS:AOP= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"xsi:schemalocation= "http://Www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp//Www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd"><context:property-placeholder location= "classpath:redis.properties"/> <context:component-scan base- Package= "Com.x.redis.dao" > </context:component-scan> <bean id= "Jedispoolconfig"class= "Redis.clients.jedis.JedisPoolConfig" > <property name= "maxidle" value= "${redis.maxidle}"/> <PR Operty name= "Maxtotal" value= "${redis.maxactive}"/> <property name= "Maxwaitmillis" value= "${redis.maxWait}" /> <property name= "Testonborrow" value= "${redis.testonborrow}"/> </bean> <bean id= "Hostpor T1 "class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "10.16.68.92"/> <constru Ctor-arg name= "Port" value= "7770"/> </bean> <bean id= "Hostport2"class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "10.16.68.92"/> <constru Ctor-arg name= "Port" value= "7771"/> </bean> <bean id= "Hostport3"class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "10.16.68.92"/> <constru Ctor-arg name= "Port" value= "7772"/> </bean> <bean id= "Hostport4"class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "10.16.68.92"/> <constru Ctor-arg name= "Port" value= "7773"/> </bean> <bean id= "Hostport5"class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "10.16.68.92"/> <constru Ctor-arg name= "Port" value= "7774"/> </bean> <bean id= "Hostport6"class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "10.16.68.92"/> <constru Ctor-arg name= "Port" value= "7775"/> </bean> <bean id= "Rediscluster"class= "Redis.clients.jedis.JedisCluster" > <constructor-arg name= "Nodes" > <set> <ref bean= "Hostport1"/> <ref bean= "Hostport2"/> <ref bean= "Hostport3"/> <ref bean= "Hostport4"/> <ref bean= "Hostport5"/> <ref bean= " Hostport6 "/> </set> </constructor-arg> <constructor-arg name=" Timeout "value=" 6000 "/> <constructor-arg name=" Poolconfig "> <ref bean=" jedispoolconfig "/> </c Onstructor-arg> </bean></beans>
Redis and Spring integrated configuration