<?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:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:p="http://www.springframework.org/schema/p"
	xsi:schemaLocation=
		"http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context-3.2.xsd
		http://www.springframework.org/schema/tx
		http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
		http://www.springframework.org/schema/aop
		http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">

	<!-- Redis 连接信息 -->
	<bean id="redisConnectionFactory"
		  class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
		<property name="hostName" value="127.0.0.1"/>
		<property name="port" value="6379"/>
		<property name="password" value=""/>
		<property name="database" value="10"/>
		<property name="poolConfig" ref="poolConfig"/>
	</bean>
	<!-- Redis 连接池配置 -->
	<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
		<!--最大空闲数-->
		<property name="maxIdle" value="300"/>
		<!--连接池的最大数据库连接数  -->
		<property name="maxTotal" value="1000"/>
		<!--最大建立连接等待时间-->
		<property name="maxWaitMillis" value="1000"/>
		<!--逐出连接的最小空闲时间 默认1800000毫秒(30分钟)-->
		<property name="minEvictableIdleTimeMillis" value="300000"/>
		<!--每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3-->
		<property name="numTestsPerEvictionRun" value="1024"/>
		<!--逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1-->
		<property name="timeBetweenEvictionRunsMillis" value="30000"/>
		<!--是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个-->
		<property name="testOnBorrow" value="true"/>
		<!--在空闲时检查有效性, 默认false  -->
		<property name="testWhileIdle" value="true"/>
	</bean>

</beans>