camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/3] git commit: CAMEL-7541 fixed the issue of RedisIdempotentRepository doesn't work out of box
Date Thu, 26 Jun 2014 06:14:59 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x f116069ed -> c25146502
  refs/heads/camel-2.13.x 2bc2f1963 -> 91f7e0d10


CAMEL-7541 fixed the issue of RedisIdempotentRepository doesn't work out of box


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4cc8db61
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4cc8db61
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4cc8db61

Branch: refs/heads/camel-2.13.x
Commit: 4cc8db61b199fc6a2f2bad46974d5f345ebe6cd8
Parents: 2bc2f19
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Jun 26 11:17:23 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Thu Jun 26 14:06:07 2014 +0800

----------------------------------------------------------------------
 components/camel-spring-redis/pom.xml                         | 7 ++++++-
 .../redis/processor/idempotent/RedisIdempotentRepository.java | 7 ++++++-
 .../component/redis/RedisComponentSpringIntegrationTest.java  | 2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4cc8db61/components/camel-spring-redis/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-redis/pom.xml b/components/camel-spring-redis/pom.xml
index 6ad4594..36e8e56 100755
--- a/components/camel-spring-redis/pom.xml
+++ b/components/camel-spring-redis/pom.xml
@@ -46,7 +46,7 @@
             <artifactId>spring-data-redis</artifactId>
             <version>${spring-data-redis-version}</version>
         </dependency>
-
+        <!-- need to add the dependency of jedis as redis client lib -->
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-test</artifactId>
@@ -72,6 +72,11 @@
             <artifactId>log4j</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>commons-pool</groupId>
+            <artifactId>commons-pool</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/camel/blob/4cc8db61/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
index 36c3c98..aad2da8 100755
--- a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
+++ b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
@@ -54,7 +54,11 @@ public class RedisIdempotentRepository extends ServiceSupport implements
Idempot
 
     @ManagedOperation(description = "Adds the key to the store")
     public boolean add(String key) {
-        return setOperations.add(processorName, key) != null;
+        if (!contains(key)) { 
+            return setOperations.add(processorName, key) != null;
+        } else {
+            return false;
+        }
     }
 
     @ManagedOperation(description = "Does the store contain the given key")
@@ -64,6 +68,7 @@ public class RedisIdempotentRepository extends ServiceSupport implements
Idempot
 
     @ManagedOperation(description = "Remove the key from the store")
     public boolean remove(String key) {
+        System.out.println("Remove the key" + key);
         return setOperations.remove(processorName, key) != null;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4cc8db61/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/RedisComponentSpringIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/RedisComponentSpringIntegrationTest.java
b/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/RedisComponentSpringIntegrationTest.java
index f2d5758..d8548bd 100755
--- a/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/RedisComponentSpringIntegrationTest.java
+++ b/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/RedisComponentSpringIntegrationTest.java
@@ -26,7 +26,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-@Ignore
+@Ignore ("IntegrationTest")
 public class RedisComponentSpringIntegrationTest extends CamelSpringTestSupport {
 
     @EndpointInject(uri = "direct:start")


Mime
View raw message