Repository: camel
Updated Branches:
  refs/heads/master de068808b -> cf303d761


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/cf303d76
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cf303d76
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cf303d76

Branch: refs/heads/master
Commit: cf303d7617bd37a835ae39f90d0c2d8731901d2c
Parents: de06880
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:13:52 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/cf303d76/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 4e5614e..4001899 100644
--- a/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc
+++ b/components/camel-hdfs2/src/main/docs/hdfs2-component.adoc
@@ -103,7 +103,7 @@ The HDFS2 component is configured using the URI syntax with 
the following path a
 | 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 or 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 or ERROR level and ignored.

http://git-wip-us.apache.org/repos/asf/camel/blob/cf303d76/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/cf303d76/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/cf303d76/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 7224d37..6b29475 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