我们分布式系统中需要实现redis 的session共享功能。现在已经实现。jedis的版本为2.9.0。但是redis还具有发布订阅消息的功能,我的系统中不需要。运维警告说,用redis的发布订阅,会导致占链接不释放,长时间会撑爆redis。我现在想要关闭redis的该功能,该如何配置。
下面是spring的配置redis的部分代码:
<bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration">
<property name="maxInactiveIntervalInSeconds" value="7200" />
<property name="redisNamespace" value="######"/>
</bean>
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxIdle" value="10" />
<property name="minIdle" value="20" />
<property name="maxTotal" value="100" />
<property name="testOnBorrow" value="true" />
</bean>