Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 127e68c19 -> c17cb6785


CAMEL-10948: Camel-hdfs2: initialDelay option is overwritten with default value


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

Branch: refs/heads/camel-2.18.x
Commit: c17cb67850c379420ad369ab554243f9befbc6bc
Parents: 127e68c
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Mon Mar 6 12:59:10 2017 +0100
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Mon Mar 6 13:20:05 2017 +0100

----------------------------------------------------------------------
 components/camel-hdfs2/src/main/docs/hdfs2-component.adoc        | 2 +-
 .../java/org/apache/camel/component/hdfs2/HdfsConfiguration.java | 4 ++--
 .../main/java/org/apache/camel/component/hdfs2/HdfsConsumer.java | 2 ++
 .../main/java/org/apache/camel/component/hdfs2/HdfsEndpoint.java | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c17cb678/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc 
b/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc
index f8a3e8c..4db8de9 100644
--- a/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc
+++ b/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc
@@ -95,7 +95,7 @@ The HDFS2 component supports 41 endpoint options which are 
listed below:
 | valueType | common | BYTES | WritableType | The type for the key in case of 
sequence or map files
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the 
consumer to the Camel routing Error Handler which mean any exceptions occurred 
while the consumer is trying to pickup incoming messages or the likes will now 
be processed as a message and handled by the routing Error Handler. By default 
the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions that will be logged at WARN/ERROR level and ignored.
 | delay | consumer | 1000 | long | The interval (milliseconds) between the 
directory scans.
-| initialDelay | consumer |  | long | For the consumer how much to wait 
(milliseconds) before to start scanning the directory.
+| initialDelay | consumer | 10000 | long | For the consumer how much to wait 
(milliseconds) before to start scanning the directory.
 | pattern | consumer | * | String | The pattern used for scanning the directory
 | sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling 
consumer did not poll any files you can enable this option to send an empty 
message (no body) instead.
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the 
consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler 
is enabled then this options is not in use. By default the consumer will deal 
with exceptions that will be logged at WARN/ERROR level and ignored.

http://git-wip-us.apache.org/repos/asf/camel/blob/c17cb678/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConfiguration.java
 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConfiguration.java
index c1f5d50..90020e3 100644
--- 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConfiguration.java
+++ 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConfiguration.java
@@ -70,8 +70,8 @@ public class HdfsConfiguration {
     private String openedSuffix = HdfsConstants.DEFAULT_OPENED_SUFFIX;
     @UriParam(label = "advanced", defaultValue = 
HdfsConstants.DEFAULT_READ_SUFFIX)
     private String readSuffix = HdfsConstants.DEFAULT_READ_SUFFIX;
-    @UriParam(label = "consumer")
-    private long initialDelay;
+    @UriParam(label = "consumer", defaultValue = "" + 
HdfsConsumer.DEFAULT_CONSUMER_INITIAL_DELAY)
+    private long initialDelay = HdfsConsumer.DEFAULT_CONSUMER_INITIAL_DELAY;
     @UriParam(label = "consumer", defaultValue = "" + 
HdfsConstants.DEFAULT_DELAY)
     private long delay = HdfsConstants.DEFAULT_DELAY;
     @UriParam(label = "consumer", defaultValue = HdfsConstants.DEFAULT_PATTERN)

http://git-wip-us.apache.org/repos/asf/camel/blob/c17cb678/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConsumer.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConsumer.java
 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConsumer.java
index 395f00b..8bb17b8 100644
--- 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConsumer.java
+++ 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsConsumer.java
@@ -40,6 +40,8 @@ public final class HdfsConsumer extends ScheduledPollConsumer 
{
     private final Processor processor;
     private final ReadWriteLock rwlock = new ReentrantReadWriteLock();
     private volatile HdfsInputStream istream;
+    
+    public static final long DEFAULT_CONSUMER_INITIAL_DELAY = 10 * 1000L;
 
     public HdfsConsumer(HdfsEndpoint endpoint, Processor processor, 
HdfsConfiguration config) {
         super(endpoint, processor);

http://git-wip-us.apache.org/repos/asf/camel/blob/c17cb678/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsEndpoint.java
 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsEndpoint.java
index baecdcc..3e9d81d 100644
--- 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsEndpoint.java
+++ 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsEndpoint.java
@@ -41,6 +41,7 @@ public class HdfsEndpoint extends ScheduledPollEndpoint {
         super(endpointUri, context);
         this.config = new HdfsConfiguration();
         this.config.parseURI(new URI(endpointUri));
+        setInitialDelay(HdfsConsumer.DEFAULT_CONSUMER_INITIAL_DELAY);
     }
 
     @Override

Reply via email to