redis.xml 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
  4. xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:tx="http://www.springframework.org/schema/tx"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans.xsd
  8. http://www.springframework.org/schema/context
  9. http://www.springframework.org/schema/context/spring-context.xsd
  10. http://www.springframework.org/schema/aop
  11. http://www.springframework.org/schema/aop/spring-aop.xsd
  12. http://www.springframework.org/schema/tx
  13. http://www.springframework.org/schema/tx/spring-tx.xsd">
  14. <!-- 引入配置文件 -->
  15. <bean name="genericObjectPoolConfig" class="org.apache.commons.pool2.impl.GenericObjectPoolConfig">
  16. <property name="maxWaitMillis" value="-1" />
  17. <property name="maxTotal" value="50" />
  18. <property name="minIdle" value="1" />
  19. <property name="maxIdle" value="40" />
  20. </bean>
  21. <bean id="jedisCluster" class="com.gyee.util.JedisClusterFactory">
  22. <property name="addressConfig">
  23. <value>classpath:redis.properties</value>
  24. </property>
  25. <property name="addressKeyPrefix" value="" /> <!-- 属性文件里 key的前缀 -->
  26. <property name="timeout" value="300000" />
  27. <property name="maxRedirections" value="12" />
  28. <property name="genericObjectPoolConfig" ref="genericObjectPoolConfig" />
  29. </bean>
  30. </beans>