1234567891011121314151617181920212223242526272829303132 |
- <?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"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
-
- <!--Jedis连接池的相关配置-->
- <bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
- <!--新版是maxTotal,旧版是maxActive-->
- <property name="maxTotal">
- <value>${redis.pool.maxActive}</value>
- </property>
- <property name="maxIdle">
- <value>${redis.pool.maxIdle}</value>
- </property>
- <property name="testOnBorrow" value="false"/>
- <property name="testOnReturn" value="false"/>
- </bean>
- <bean id="jedisPool" class="redis.clients.jedis.JedisPool" depends-on="jedisPoolConfig">
- <constructor-arg name ="poolConfig" ref="jedisPoolConfig" ></constructor-arg>
-
- <constructor-arg name="host" value="${redis.host}" />
- <constructor-arg name="port" value="${redis.port}" type="int" />
- <constructor-arg name="timeout" value="${redis.timeout}" type="int" />
- </bean>
- </beans>
|