2014-05-15 7 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

문제는 주변의 잘못된 봄 데이터 레디 스 TX 동기화 알고리즘 - 그것은 bugs있다.

그것은 고정 1.3 GA 오늘 나와 같은 문제를 사로 잡았처럼