2014-05-15 14 views
0

我在我的机器上安装了Redis,并且在我的Spring应用程序中使用Jedis客户端将一些数据写入Redis。由于某些原因,每次写入时,连接到Redis的连接数量一直在堆积,直到出现JedisConnectionFailureException。连接继续在Java客户端的Redis中堆积

我的春天Jedis配置文件是这样的:

<?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:p="http://www.springframework.org/schema/p" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans.xsd"> 


<!-- Redis conection factory configurations --> 
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" 
            p:host-name="${redis.host}" 
            p:port="${redis.port}" 
            p:password="${redis.password}" 
            p:use-pool="true" /> 

<!-- Redis String Serializer --> 
<bean id="stringRedisSerializer" class="org.springframework.data.redis.serializer.StringRedisSerializer"/> 

<!-- JDK Serialization Redis Serializer --> 
<bean id="jdkSerializationRedisSerializer" class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer"/> 

<!-- Configuring the Redis Template --> 
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate" 
          p:connection-factory-ref="redisConnectionFactory" 
          p:keySerializer-ref="stringRedisSerializer" 
          p:valueSerializer-ref="jdkSerializationRedisSerializer" /> 

在我的整个应用程序,这就是我创建连接的唯一地方。

在我的弹簧应用程序,我使用的连接如下:

redisTemplate.opsForValue().set("key", "value"); 
+0

看起来你今天擦肩而过,同样的问题我:jira.spring.io/browse/DATAREDIS-300 –

+0

你能与最新的SD试试吧-Redis SNAPSHOT?提到的问题已经修复,我的应用程序现在运行良好 –

+0

哦!该错误在spring-data-redis中。我应该检查。你能否为我提供正确版本的maven仓库? – abbasdgr8

回答

0

的问题是围绕错春数据Redis的TX同步算法 - 它有bugs

已固定,可自从春天数据Redis的1.3 GA