You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/12/10 15:53:29 UTC

[camel] branch master updated: CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - Optaplanner Component

This is an automated email from the ASF dual-hosted git repository.

acosentino 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 85555a7  CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - Optaplanner Component
85555a7 is described below

commit 85555a7a6b0dab40743a648d221755f5a3a9bb73
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 10 16:52:57 2019 +0100

    CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - Optaplanner Component
---
 .../org/apache/camel/component/optaplanner/OptaPlannerComponent.java | 5 +++--
 .../org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java  | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
index fb609bf..65a2a1c 100644
--- a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
+++ b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
@@ -34,7 +34,6 @@ public class OptaPlannerComponent extends DefaultComponent {
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         OptaPlannerConfiguration configuration = new OptaPlannerConfiguration();
         configuration.setConfigFile(remaining);
-        setProperties(configuration, parameters);
         
         // [CAMEL-11889] Kie assumes that the TCCL can load its services
         ClassLoader tccl = Thread.currentThread().getContextClassLoader();
@@ -46,7 +45,9 @@ public class OptaPlannerComponent extends DefaultComponent {
             Thread.currentThread().setContextClassLoader(tccl);
         }
         
-        return new OptaPlannerEndpoint(uri, this, configuration);
+        OptaPlannerEndpoint answer = new OptaPlannerEndpoint(uri, this, configuration);
+        setProperties(answer, parameters);
+        return answer;
     }
 
 }
diff --git a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
index aed9ee5..08b3763 100644
--- a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
+++ b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
@@ -78,7 +78,9 @@ public class OptaPlannerEndpoint extends DefaultEndpoint {
 
     @Override
     public Consumer createConsumer(Processor processor) throws Exception {
-        return new OptaPlannerConsumer(this, processor, configuration);
+    	OptaPlannerConsumer consumer = new OptaPlannerConsumer(this, processor, configuration);
+        configureConsumer(consumer);
+        return consumer;
     }
 
     @Override