spring-website-redis.xml 1.57 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd"
       default-autowire="byName">
    
    <!--统一管理平台Manage所需redis 权限控制等 -->
    <bean id="jedisPoolConfig1" class="redis.clients.jedis.JedisPoolConfig">
        <!--最大连接池数 默认是8-->
        <property name="maxTotal" value="1000" />
        <!--最大空闲连接数 默认是8-->
        <property name="maxIdle" value="500" />
        <!--最大等待时间 毫秒为单位  设置为10秒钟-->
        <property name="maxWaitMillis" value="10000" />
        <property name="testOnBorrow" value="true" />
    </bean>
    <bean id="jedis.shardInfo1" class="redis.clients.jedis.JedisShardInfo">
        <constructor-arg index="0" value="${project.redis.host1}" />
        <constructor-arg index="1" value="${project.redis.port1}" />
    </bean>
    <bean id="shardedJedisPool1" class="redis.clients.jedis.ShardedJedisPool">
        <constructor-arg index="0" ref="jedisPoolConfig1" />
        <constructor-arg index="1">
            <list>
                <ref bean="jedis.shardInfo1" />
            </list>
        </constructor-arg>
    </bean>

    <bean id="manageRedisUtil" class="com.diligrp.website.util.redis.impl.RedisUtilImpl">
        <property name="shardedJedisPool" ref="shardedJedisPool1" />
        <property name="keyRule" value="" />
    </bean>
</beans>