<!-- 开启缓存注解 -->
<cache:annotation-driven />
<!-- jedis客户端连接工厂 -->
<bean id="jedisConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="usePool" value="true" />
<property name="hostName" value="${redis.ip}" />
<property name="port" value="${redis.port}" />
<property name="poolConfig" ref="jedisPoolConfig" />
</bean>
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="${redis.pool.maxTotal}" />
<!--最大空闲连接数 -->
<property name="maxIdle" value="${redis.pool.maxIdle}" />
<!--初始化连接数 -->
<property name="minIdle" value="${redis.poo
Spring配置jedis连接池
最新推荐文章于 2024-07-21 02:56:05 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)