You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/12/12 12:45:31 UTC
[camel] branch master updated: CAMEL-14284: Configuring endpoint
should set properties on endpoint and not configuration object -
spring-redis
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 73891fd CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - spring-redis
73891fd is described below
commit 73891fd53968662efdc456bc485e5be7e8291394
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Dec 12 13:45:17 2019 +0100
CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - spring-redis
---
.../java/org/apache/camel/component/redis/RedisComponent.java | 5 ++---
.../java/org/apache/camel/component/redis/RedisEndpoint.java | 9 +++++++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisComponent.java b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisComponent.java
index d52129e..5379e34 100644
--- a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisComponent.java
+++ b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisComponent.java
@@ -34,12 +34,11 @@ public class RedisComponent extends DefaultComponent {
}
@Override
- protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters)
- throws Exception {
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
RedisConfiguration configuration = new RedisConfiguration();
setHostAndPort(configuration, remaining);
- setProperties(configuration, parameters);
RedisEndpoint endpoint = new RedisEndpoint(uri, this, configuration);
+ setProperties(endpoint, parameters);
return endpoint;
}
diff --git a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisEndpoint.java b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisEndpoint.java
index 24e5722..38ffcd6 100644
--- a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisEndpoint.java
+++ b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisEndpoint.java
@@ -36,8 +36,6 @@ public class RedisEndpoint extends DefaultEndpoint {
public RedisEndpoint(String uri, RedisComponent component, RedisConfiguration configuration) {
super(uri, component);
this.configuration = configuration;
- redisProcessorsCreator = new AllRedisProcessorsCreator(new RedisClient(configuration.getRedisTemplate()),
- ((RedisComponent)getComponent()).getExchangeConverter());
}
@Override
@@ -60,6 +58,13 @@ public class RedisEndpoint extends DefaultEndpoint {
}
@Override
+ protected void doInit() throws Exception {
+ super.doInit();
+ redisProcessorsCreator = new AllRedisProcessorsCreator(new RedisClient(configuration.getRedisTemplate()),
+ ((RedisComponent)getComponent()).getExchangeConverter());
+ }
+
+ @Override
protected void doShutdown() throws Exception {
super.doShutdown();
configuration.stop();