spring-config-redis.xml
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:redisson="http://redisson.org/schema/redisson"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
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
http://redisson.org/schema/redisson
http://redisson.org/schema/redisson/redisson.xsd">
<bean name="genericObjectPoolConfig" class="org.apache.commons.pool2.impl.GenericObjectPoolConfig" >
<property name="maxWaitMillis" value="-1" />
<property name="maxTotal" value="1000" />
<property name="minIdle" value="8" />
<property name="maxIdle" value="100" />
</bean>
<!-- 测试环境属性文件位置 -->
<bean id="jedisClusterFactorys" class="com.sibu.orderHelper.common.redis.JedisClusterFactory">
<property name="prop" ref="redisResources"></property>
<property name="addressKeyPrefix" value="address" /> <!-- 属性文件里 key的前缀 -->
<property name="timeout" value="300000" />
<property name="maxRedirections" value="6" />
<property name="genericObjectPoolConfig" ref="genericObjectPoolConfig" />
</bean>
<!-- redis服务封装 -->
<bean id="redisClusterService" class="com.sibu.orderHelper.common.redis.RedisClusterService" >
<property name="jedisCluster" ref="jedisClusterFactorys"></property>
</bean>
<!-- redis redisson客户端 集群服务配置 -->
<!--<bean id="redissonClient" class="com.sibu.orderHelper.common.redis.redisson.RedissonClientFactory">-->
<!--<property name="addressKeyPrefix" value="address" />-->
<!--<property name="prop" ref="redisResources"></property>-->
<!--</bean>-->
</beans>