You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/06/26 08:15:00 UTC
[2/3] git commit: CAMEL-7541 fixed the issue of
RedisIdempotentRepository doesn't work out of box
CAMEL-7541 fixed the issue of RedisIdempotentRepository doesn't work out of box
Conflicts:
components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
#
# It looks like you may be committing a cherry-pick.
# If this is not correct, please remove the file
# .git/CHERRY_PICK_HEAD
# and try again.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch camel-2.12.x
# You are currently cherry-picking.
# (all conflicts fixed: run "git cherry-pick --continue")
# (use "git cherry-pick --abort" to cancel the cherry-pick operation)
#
# Changes to be committed:
#
# modified: components/camel-spring-redis/pom.xml
# modified: components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
# modified: components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/RedisComponentSpringIntegrationTest.java
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# components/camel-cxf/activemq-data/
# components/camel-cxf/pom.xml.orig
# components/camel-cxf/pom.xml.rej
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c2514650
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c2514650
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c2514650
Branch: refs/heads/camel-2.12.x
Commit: c25146502512c46db2c3f4c69379dda74b57d1a8
Parents: f116069
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Jun 26 11:17:23 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Jun 26 14:12:51 2014 +0800
----------------------------------------------------------------------
components/camel-spring-redis/pom.xml | 7 ++++++-
.../processor/idempotent/RedisIdempotentRepository.java | 8 ++++++--
.../component/redis/RedisComponentSpringIntegrationTest.java | 2 +-
3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/c2514650/components/camel-spring-redis/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-redis/pom.xml b/components/camel-spring-redis/pom.xml
index e381d45..1238dd5 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/c2514650/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 82dc57c..ec06081 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);
+ if (!contains(key)) {
+ return setOperations.add(processorName, key) != null;
+ } else {
+ return false;
+ }
}
@ManagedOperation(description = "Does the store contain the given key")
@@ -64,7 +68,7 @@ public class RedisIdempotentRepository extends ServiceSupport implements Idempot
@ManagedOperation(description = "Remove the key from the store")
public boolean remove(String key) {
- return setOperations.remove(processorName, key);
+ return setOperations.remove(processorName, key) != null;
}
@ManagedAttribute(description = "The processor name")
http://git-wip-us.apache.org/repos/asf/camel/blob/c2514650/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")