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/11 07:52:16 UTC

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

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 184079a  CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - Dropbox component
184079a is described below

commit 184079af017a2fb65f26c518ccf652bfe6591d2a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Dec 11 08:51:59 2019 +0100

    CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - Dropbox component
---
 .../java/org/apache/camel/component/dropbox/DropboxComponent.java  | 7 +++----
 .../java/org/apache/camel/component/dropbox/DropboxEndpoint.java   | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxComponent.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxComponent.java
index 1ce19aa..8b0192a 100644
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxComponent.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxComponent.java
@@ -74,14 +74,13 @@ public class DropboxComponent extends DefaultComponent {
             configuration.setUploadMode(DropboxUploadMode.valueOf((String)parameters.get("uploadMode")));
         }
 
+        DropboxEndpoint endpoint = new DropboxEndpoint(uri, this, configuration);
+        setProperties(endpoint, parameters);
 
         //pass validation test
         DropboxConfigurationValidator.validateCommonProperties(configuration);
 
-        // and then override from parameters
-        setProperties(configuration, parameters);
-
-        return new DropboxEndpoint(uri, this, configuration);
+        return endpoint;
     }
 
 }
diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
index 379723b..5de67aa 100644
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
@@ -97,10 +97,12 @@ public class DropboxEndpoint extends DefaultEndpoint {
         if (this.configuration.getOperation() == DropboxOperation.search) {
             consumer = new DropboxScheduledPollSearchConsumer(this, processor, configuration);
             consumer.setDelay(DropboxConstants.POLL_CONSUMER_DELAY);
+            configureConsumer(consumer);
             return consumer;
         } else if (this.configuration.getOperation() == DropboxOperation.get) {
             consumer = new DropboxScheduledPollGetConsumer(this, processor, configuration);
             consumer.setDelay(DropboxConstants.POLL_CONSUMER_DELAY);
+            configureConsumer(consumer);
             return consumer;
         } else {
             throw new DropboxException("Operation specified is not valid for consumer!");