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 2016/12/08 14:12:34 UTC

[01/16] camel git commit: Polished

Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x e843b7d83 -> 2e2a49eb3
  refs/heads/master 26553b930 -> 7597ed828


Polished


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

Branch: refs/heads/master
Commit: 1d6c88945a90ca7bb97f14a3b4d6bdb754957e34
Parents: 26553b9
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 13:26:55 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 13:26:55 2016 +0100

----------------------------------------------------------------------
 camel-core/pom.xml | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1d6c8894/camel-core/pom.xml
----------------------------------------------------------------------
diff --git a/camel-core/pom.xml b/camel-core/pom.xml
index c5f4da5..ce83d6a 100644
--- a/camel-core/pom.xml
+++ b/camel-core/pom.xml
@@ -311,12 +311,6 @@
         </configuration>
       </plugin>
 
-      <!--<classesDirectory>${project.build.outputDirectory}</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/components</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/dataformats</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/languages</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/models</classesDirectory>-->
-
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>


[08/16] camel git commit: Fixed invalid component json schema discovered by mvn camel:validate

Posted by da...@apache.org.
Fixed invalid component json schema discovered by mvn camel:validate


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

Branch: refs/heads/master
Commit: 99eafcb9b1069e601fdfb2dbd9de85f9b07fb121
Parents: bfdc671
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:48:18 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:48:18 2016 +0100

----------------------------------------------------------------------
 .../camel/component/gridfs/GridFsConsumer.java  |  1 -
 .../camel/component/gridfs/GridFsEndpoint.java  | 10 ++------
 .../camel/component/gridfs/QueryStrategy.java   | 25 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/99eafcb9/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
index bfce711..6df4391 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
@@ -31,7 +31,6 @@ import com.mongodb.util.JSON;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.component.gridfs.GridFsEndpoint.QueryStrategy;
 import org.apache.camel.impl.DefaultConsumer;
 
 /**

http://git-wip-us.apache.org/repos/asf/camel/blob/99eafcb9/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
index 13aa862..cb8f686 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
@@ -38,14 +38,8 @@ import org.slf4j.LoggerFactory;
  */
 @UriEndpoint(scheme = "gridfs", title = "MongoDBGridFS", syntax = "gridfs:connectionBean", label = "database,nosql")
 public class GridFsEndpoint extends DefaultEndpoint {
-    
-    public enum QueryStrategy {
-        TimeStamp,
-        PersistentTimestamp,
-        FileAttribute,
-        TimeStampAndFileAttribute,
-        PersistentTimestampAndFileAttribute
-    };
+
+    ;
     public static final String GRIDFS_OPERATION = "gridfs.operation";
     public static final String GRIDFS_METADATA = "gridfs.metadata";
     public static final String GRIDFS_CHUNKSIZE = "gridfs.chunksize";

http://git-wip-us.apache.org/repos/asf/camel/blob/99eafcb9/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java
new file mode 100644
index 0000000..9b29f2a
--- /dev/null
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.gridfs;
+
+public enum QueryStrategy {
+    TimeStamp,
+    PersistentTimestamp,
+    FileAttribute,
+    TimeStampAndFileAttribute,
+    PersistentTimestampAndFileAttribute
+}


[14/16] camel git commit: Fixed invalid component json schema discovered by mvn camel:validate

Posted by da...@apache.org.
Fixed invalid component json schema discovered by mvn camel:validate


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

Branch: refs/heads/camel-2.18.x
Commit: efe091d2d9044766c531f4d33feda168c4159985
Parents: 896b435
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:31:08 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:12:00 2016 +0100

----------------------------------------------------------------------
 .../src/main/docs/etcd-component.adoc           | 17 ++++-
 .../etcd/AbstractEtcdPollingConsumer.java       |  2 +-
 .../etcd/AbstractEtcdPollingEndpoint.java       | 69 ++++++++++++++++++++
 .../component/etcd/AbstractEtcdProducer.java    |  3 +-
 .../camel/component/etcd/EtcdStatsEndpoint.java |  2 +-
 .../camel/component/etcd/EtcdStatsTest.java     |  6 +-
 .../camel/component/etcd/EtcdWatchTest.java     |  2 +-
 7 files changed, 93 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/main/docs/etcd-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/docs/etcd-component.adoc b/components/camel-etcd/src/main/docs/etcd-component.adoc
index 6e6a35e..0cbfaf1 100644
--- a/components/camel-etcd/src/main/docs/etcd-component.adoc
+++ b/components/camel-etcd/src/main/docs/etcd-component.adoc
@@ -13,7 +13,7 @@
 
 
 // endpoint options: START
-The etcd component supports 16 endpoint options which are listed below:
+The etcd component supports 31 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
@@ -27,11 +27,26 @@ The etcd component supports 16 endpoint options which are listed below:
 | uris | common | http://localhost:2379,http://localhost:4001 | String | To set the URIs the client connects.
 | 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.
 | sendEmptyExchangeOnTimeout | consumer | false | boolean | To send an empty message in case of timeout watching for a key.
+| 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.
 | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
 | fromIndex | consumer (advanced) | 0 | Long | The index to watch from
+| pollStrategy | consumer (advanced) |  | PollingConsumerPollStrategy | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.
 | timeToLive | producer |  | Integer | To set the lifespan of a key in milliseconds.
 | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| backoffErrorThreshold | scheduler |  | int | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
+| backoffIdleThreshold | scheduler |  | int | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
+| backoffMultiplier | scheduler |  | int | To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.
+| delay | scheduler | 500 | long | Milliseconds before the next poll. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| greedy | scheduler | false | boolean | If greedy is enabled then the ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages.
+| initialDelay | scheduler | 1000 | long | Milliseconds before the first poll starts. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| runLoggingLevel | scheduler | TRACE | LoggingLevel | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.
+| scheduledExecutorService | scheduler |  | ScheduledExecutorService | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.
+| scheduler | scheduler | none | ScheduledPollConsumerScheduler | To use a cron scheduler from either camel-spring or camel-quartz2 component
+| schedulerProperties | scheduler |  | Map | To configure additional properties when using a custom scheduler or any of the Quartz2 Spring based scheduler.
+| startScheduler | scheduler | true | boolean | Whether the scheduler should be auto started.
+| timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay and delay options.
+| useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
 | password | security |  | String | The password to use for basic authentication.
 | sslContextParameters | security |  | SSLContextParameters | To configure security using SSLContextParameters.
 | userName | security |  | String | The user name to use for basic authentication.

http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
index 80ba445..b069c63 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
@@ -30,7 +30,7 @@ public abstract class AbstractEtcdPollingConsumer extends ScheduledPollConsumer
 
     private EtcdClient client;
 
-    protected AbstractEtcdPollingConsumer(AbstractEtcdEndpoint endpoint, Processor processor, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
+    protected AbstractEtcdPollingConsumer(AbstractEtcdPollingEndpoint endpoint, Processor processor, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
         super(endpoint, processor);
 
         this.configuration = configuration;

http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java
new file mode 100644
index 0000000..f00996e
--- /dev/null
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.etcd;
+
+import mousio.etcd4j.EtcdClient;
+import org.apache.camel.impl.DefaultPollingEndpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+
+/**
+ * The camel etcd component allows you to work with <a href="https://coreos.com/etcd">Etcd</a>, a distributed, A distributed, reliable key-value store.
+ */
+@UriEndpoint(scheme = "etcd", title = "etcd", syntax = "etcd:namespace/path", consumerClass = AbstractEtcdConsumer.class, label = "etcd")
+public abstract class AbstractEtcdPollingEndpoint extends DefaultPollingEndpoint {
+
+    @UriPath(description = "The API namespace to use", enums = "keys,stats,watch")
+    @Metadata(required = "true")
+    private final EtcdNamespace namespace;
+    @UriPath(description = "The path the enpoint refers to")
+    @Metadata(required = "false")
+    private final String path;
+    @UriParam
+    private final EtcdConfiguration configuration;
+
+    protected AbstractEtcdPollingEndpoint(String uri, EtcdComponent component, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
+        super(uri, component);
+
+        this.configuration = configuration;
+        this.namespace = namespace;
+        this.path = path;
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
+
+    public EtcdConfiguration getConfiguration() {
+        return this.configuration;
+    }
+
+    public EtcdNamespace getNamespace() {
+        return this.namespace;
+    }
+
+    public String getPath() {
+        return this.path;
+    }
+
+    public EtcdClient createClient() throws Exception {
+        return configuration.createClient();
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
index ab6a4ef..56d80e6 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.etcd;
 
 import mousio.etcd4j.EtcdClient;
+import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultProducer;
 
 /**
@@ -29,7 +30,7 @@ public abstract class AbstractEtcdProducer extends DefaultProducer {
 
     private EtcdClient client;
 
-    protected AbstractEtcdProducer(AbstractEtcdEndpoint endpoint, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
+    protected AbstractEtcdProducer(Endpoint endpoint, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
         super(endpoint);
 
         this.configuration = configuration;

http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
index a081771..7bb41c2 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
@@ -21,7 +21,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 
-public class EtcdStatsEndpoint extends AbstractEtcdEndpoint {
+public class EtcdStatsEndpoint extends AbstractEtcdPollingEndpoint {
 
     public EtcdStatsEndpoint(
         String uri, EtcdComponent component, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {

http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
index 6af0148..b5dfb83 100644
--- a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
+++ b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
@@ -64,11 +64,11 @@ public class EtcdStatsTest extends EtcdTestSupport {
         return new RouteBuilder() {
             public void configure() {
                 // CONSUMER
-                from("etcd:stats/leader?consumer.delay=50&consumer.initialDelay=0")
+                from("etcd:stats/leader?delay=50&initialDelay=0")
                     .to("mock:stats-leader-consumer");
-                from("etcd:stats/self?consumer.delay=50&consumer.initialDelay=0")
+                from("etcd:stats/self?delay=50&initialDelay=0")
                     .to("mock:stats-self-consumer");
-                from("etcd:stats/store?consumer.delay=50&consumer.initialDelay=0")
+                from("etcd:stats/store?delay=50&initialDelay=0")
                     .to("mock:stats-store-consumer");
 
                 // PRODUCER

http://git-wip-us.apache.org/repos/asf/camel/blob/efe091d2/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
index fad8687..3707bcf 100644
--- a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
+++ b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
@@ -102,7 +102,7 @@ public class EtcdWatchTest extends EtcdTestSupport {
                 from("etcd:watch/myKey1")
                     .process(NODE_TO_VALUE_IN)
                     .to("mock:watch-with-path");
-                fromF("etcd:watch/myKeyRecovery?timeout=%d&fromIndex=%d", 1000 * 60 * 5, 1)
+                fromF("etcd:watch/myKeyRecovery?timeout=%s&fromIndex=%s", 1000 * 60 * 5, 1)
                     .id("watchRecovery")
                     .autoStartup(false)
                     .process(NODE_TO_VALUE_IN)


[10/16] camel git commit: Camel catalog - Should ignore validating uri parameters where the key is a placeholder and therefore not a known key name.

Posted by da...@apache.org.
Camel catalog - Should ignore validating uri parameters where the key is a placeholder and therefore not a known key name.


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

Branch: refs/heads/master
Commit: 7597ed828f591429d5e4ce7c98de110bc5256c41
Parents: 1163998
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 15:03:22 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:05:46 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/catalog/URISupport.java     | 14 ++++++++++++--
 .../org/apache/camel/catalog/CamelCatalogTest.java    | 12 ++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7597ed82/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java b/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
index 8cc0f69..ea1ecd5 100644
--- a/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
+++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
@@ -230,7 +230,12 @@ public final class URISupport {
                 // the & denote parameter is ended
                 if (ch == '&') {
                     // parameter is ended, as we hit & separator
-                    addParameter(key.toString(), value.toString(), rc, useRaw || isRaw);
+                    String aKey = key.toString();
+                    // the key may be a placeholder of options which we then do not know what is
+                    boolean validKey = !aKey.startsWith("{{") && !aKey.endsWith("}}");
+                    if (validKey) {
+                        addParameter(aKey, value.toString(), rc, useRaw || isRaw);
+                    }
                     key.setLength(0);
                     value.setLength(0);
                     isKey = true;
@@ -249,7 +254,12 @@ public final class URISupport {
 
             // any left over parameters, then add that
             if (key.length() > 0) {
-                addParameter(key.toString(), value.toString(), rc, useRaw || isRaw);
+                String aKey = key.toString();
+                // the key may be a placeholder of options which we then do not know what is
+                boolean validKey = !aKey.startsWith("{{") && !aKey.endsWith("}}");
+                if (validKey) {
+                    addParameter(aKey, value.toString(), rc, useRaw || isRaw);
+                }
             }
 
             return rc;

http://git-wip-us.apache.org/repos/asf/camel/blob/7597ed82/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
index 271ca3f..85a6076 100644
--- a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
+++ b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
@@ -866,4 +866,16 @@ public class CamelCatalogTest {
         assertTrue(doc.contains("JSonPath language"));
     }
 
+    @Test
+    public void testValidateEndpointTwitterSpecial() throws Exception {
+        String uri = "twitter://search?{{%s}}&keywords=java";
+
+        EndpointValidationResult result = catalog.validateEndpointProperties(uri);
+        assertTrue(result.isSuccess());
+
+        uri = "twitter://search?{{%s}}";
+        result = catalog.validateEndpointProperties(uri);
+        assertTrue(result.isSuccess());
+    }
+
 }


[09/16] camel git commit: CAMEL-10559: maven plugin to validate using the route parser. Donated from fabric8 project.

Posted by da...@apache.org.
CAMEL-10559: maven plugin to validate using the route parser. Donated from fabric8 project.


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

Branch: refs/heads/master
Commit: 1163998329ee1f26dc0236c7bf962b7d960551a5
Parents: 99eafcb
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:56:12 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:56:12 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/maven/ValidateMojo.java         | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/11639983/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
index 3a63cdc..9d41a9d 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
@@ -298,6 +298,7 @@ public class ValidateMojo extends AbstractExecMojo {
         int unknownComponents = 0;
         int incapableErrors = 0;
         for (CamelEndpointDetails detail : endpoints) {
+            getLog().debug("Validating endpoint: " + detail.getEndpointUri());
             EndpointValidationResult result = catalog.validateEndpointProperties(detail.getEndpointUri(), ignoreLenientProperties);
 
             boolean ok = result.isSuccess();
@@ -399,6 +400,7 @@ public class ValidateMojo extends AbstractExecMojo {
 
         int simpleErrors = 0;
         for (CamelSimpleExpressionDetails detail : simpleExpressions) {
+            getLog().debug("Validating simple expression: " + detail.getSimple());
             SimpleValidationResult result = catalog.validateSimpleExpression(detail.getSimple());
             if (!result.isSuccess()) {
                 simpleErrors++;


[12/16] camel git commit: Fixed invalid component json schema discovered by mvn camel:validate

Posted by da...@apache.org.
Fixed invalid component json schema discovered by mvn camel:validate


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

Branch: refs/heads/camel-2.18.x
Commit: f059f9d408cfe199671d9243f9dc0d1460551210
Parents: 7258bfa
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:09:42 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:11:36 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/aws/ec2/EC2Configuration.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f059f9d4/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
index a7cc109..c558eb0 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
@@ -36,9 +36,7 @@ public class EC2Configuration {
     private String secretKey;
     @UriParam
     private String amazonEc2Endpoint;
-    @UriParam (label = "producer", enums = "createAndRunInstances, startInstances, stopInstances, terminateInstances, "
-              + "describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, " 
-              + "createTags, deleteTags")
+    @UriParam(label = "producer")
     @Metadata(required = "true")
     private EC2Operations operation;
     @UriParam


[04/16] camel git commit: Polished

Posted by da...@apache.org.
Polished


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

Branch: refs/heads/master
Commit: ee10f61a5759a9e4f59c596a26a4c9aac7a4db5a
Parents: 578ddfa
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:22:40 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:22:40 2016 +0100

----------------------------------------------------------------------
 .../camel/component/mina2/Mina2SslContextParametersTcpTest.java | 5 ++---
 .../camel/component/mina2/Mina2SslContextParametersVmTest.java  | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ee10f61a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
index fbb0bac..9752d5b 100644
--- a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
+++ b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
@@ -31,8 +31,7 @@ public class Mina2SslContextParametersTcpTest extends BaseMina2Test {
         Object body = "Hello there!";
         endpoint.expectedBodiesReceived(body);
 
-        template.sendBodyAndHeader(String.format("mina2:tcp://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters",
-                getPort()), body, "cheese", 123);
+        template.sendBodyAndHeader("mina2:tcp://localhost:" + getPort() + "?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", body, "cheese", 123);
 
         assertMockEndpointsSatisfied();
     }
@@ -46,7 +45,7 @@ public class Mina2SslContextParametersTcpTest extends BaseMina2Test {
         return new RouteBuilder() {
 
             public void configure() {
-                fromF("mina2:tcp://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
+                fromF("mina2:tcp://localhost:%s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
                         .to("log:before?showAll=true")
                         .to("mock:result").to("log:after?showAll=true");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/ee10f61a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
index 21b53bb..649a32d 100644
--- a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
+++ b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
@@ -31,8 +31,7 @@ public class Mina2SslContextParametersVmTest extends BaseMina2Test {
         Object body = "Hello there!";
         endpoint.expectedBodiesReceived(body);
 
-        template.sendBodyAndHeader(String.format("mina2:vm://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters",
-                getPort()), body, "cheese", 123);
+        template.sendBodyAndHeader("mina2:vm://localhost:" + getPort() + "?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", body, "cheese", 123);
 
         assertMockEndpointsSatisfied();
     }
@@ -46,7 +45,7 @@ public class Mina2SslContextParametersVmTest extends BaseMina2Test {
         return new RouteBuilder() {
 
             public void configure() {
-                fromF("mina2:vm://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
+                fromF("mina2:vm://localhost:%s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
                         .to("log:before?showAll=true").to("mock:result")
                         .to("log:after?showAll=true");
             }


[11/16] camel git commit: Polished

Posted by da...@apache.org.
Polished


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

Branch: refs/heads/camel-2.18.x
Commit: 7258bfaaced4f2c0a342ef9bca0ad3cb50911728
Parents: e843b7d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 13:26:55 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:11:27 2016 +0100

----------------------------------------------------------------------
 camel-core/pom.xml | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7258bfaa/camel-core/pom.xml
----------------------------------------------------------------------
diff --git a/camel-core/pom.xml b/camel-core/pom.xml
index 7faeb42..f8cce92 100644
--- a/camel-core/pom.xml
+++ b/camel-core/pom.xml
@@ -309,12 +309,6 @@
         </configuration>
       </plugin>
 
-      <!--<classesDirectory>${project.build.outputDirectory}</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/components</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/dataformats</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/languages</classesDirectory>-->
-      <!--<classesDirectory>${project.build}/generated/camel/models</classesDirectory>-->
-
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>


[07/16] camel git commit: CAMEL-10559: maven plugin to validate using the route parser. Donated from fabric8 project.

Posted by da...@apache.org.
CAMEL-10559: maven plugin to validate using the route parser. Donated from fabric8 project.


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

Branch: refs/heads/master
Commit: bfdc6710b5e1ce6e69a226763719d909fc4cfb03
Parents: ecb7d5d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:35:46 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:44:03 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/parser/helper/CamelJavaParserHelper.java    | 4 +++-
 .../src/main/java/org/apache/camel/maven/ValidateMojo.java       | 2 --
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bfdc6710/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaParserHelper.java
----------------------------------------------------------------------
diff --git a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaParserHelper.java b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaParserHelper.java
index 6df709a..b433543 100644
--- a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaParserHelper.java
+++ b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaParserHelper.java
@@ -311,9 +311,11 @@ public final class CamelJavaParserHelper {
             if (!Strings.isBlank(uri)) {
                 int position = ((Expression) arg).getStartPosition();
 
-                // if the node is fromF or toF, then replace all %s with {{%s}} as we cannot parse that value
+                // if the node is fromF or toF, then replace all %X with {{%X}} as we cannot parse that value
                 if ("fromF".equals(node) || "toF".equals(node)) {
                     uri = uri.replaceAll("\\%s", "\\{\\{\\%s\\}\\}");
+                    uri = uri.replaceAll("\\%d", "\\{\\{\\%d\\}\\}");
+                    uri = uri.replaceAll("\\%b", "\\{\\{\\%b\\}\\}");
                 }
 
                 uris.add(new ParserResult(node, position, uri));

http://git-wip-us.apache.org/repos/asf/camel/blob/bfdc6710/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
index 579c6f5..3a63cdc 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
@@ -49,8 +49,6 @@ import org.jboss.forge.roaster.model.source.JavaClassSource;
  * Parses the source code and validates the Camel routes has valid endpoint uris and simple expressions.
  *
  * @goal validate
- * @requiresDependencyResolution compile+runtime
- * @execute phase="process-test-classes"
  */
 public class ValidateMojo extends AbstractExecMojo {
 


[03/16] camel git commit: Fixed invalid component json schema discovered by mvn camel:validate

Posted by da...@apache.org.
Fixed invalid component json schema discovered by mvn camel:validate


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

Branch: refs/heads/master
Commit: 578ddfa544fedbbf24c56a0fc783116b1e7be19d
Parents: 3905816
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:09:42 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:09:42 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/aws/ec2/EC2Configuration.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/578ddfa5/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
index a7cc109..c558eb0 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java
@@ -36,9 +36,7 @@ public class EC2Configuration {
     private String secretKey;
     @UriParam
     private String amazonEc2Endpoint;
-    @UriParam (label = "producer", enums = "createAndRunInstances, startInstances, stopInstances, terminateInstances, "
-              + "describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, " 
-              + "createTags, deleteTags")
+    @UriParam(label = "producer")
     @Metadata(required = "true")
     private EC2Operations operation;
     @UriParam


[02/16] camel git commit: Add camel:validate

Posted by da...@apache.org.
Add camel:validate


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

Branch: refs/heads/master
Commit: 390581688818bfbc07233befd7f0dd01d7cbfb2c
Parents: 1d6c889
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 13:43:28 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:04:39 2016 +0100

----------------------------------------------------------------------
 camel-core/pom.xml | 12 ++++++++++++
 components/pom.xml | 13 +++++++++++++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/39058168/camel-core/pom.xml
----------------------------------------------------------------------
diff --git a/camel-core/pom.xml b/camel-core/pom.xml
index ce83d6a..8cea9a6 100644
--- a/camel-core/pom.xml
+++ b/camel-core/pom.xml
@@ -330,6 +330,18 @@
         </configuration>
       </plugin>
 
+      <!-- to validate Camel endpoints: mvn camel:validate -->
+      <plugin>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-maven-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <failOnError>true</failOnError>
+          <includeTest>true</includeTest>
+          <ignoreLenientProperties>false</ignoreLenientProperties>
+        </configuration>
+      </plugin>
+
       <plugin>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-package-maven-plugin</artifactId>

http://git-wip-us.apache.org/repos/asf/camel/blob/39058168/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 8f7d0e5..8ccc94e 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -315,6 +315,19 @@
           </execution>
         </executions>
       </plugin>
+
+      <!-- to validate Camel endpoints: mvn camel:validate -->
+      <plugin>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-maven-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <failOnError>false</failOnError>
+          <includeTest>true</includeTest>
+          <ignoreLenientProperties>false</ignoreLenientProperties>
+        </configuration>
+      </plugin>
+
     </plugins>
   </build>
 


[15/16] camel git commit: Fixed invalid component json schema discovered by mvn camel:validate

Posted by da...@apache.org.
Fixed invalid component json schema discovered by mvn camel:validate


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

Branch: refs/heads/camel-2.18.x
Commit: dc7ed4d442ef0841a587fb0966e16921d1129da4
Parents: efe091d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:48:18 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:12:12 2016 +0100

----------------------------------------------------------------------
 .../camel/component/gridfs/GridFsConsumer.java  |  1 -
 .../camel/component/gridfs/GridFsEndpoint.java  | 10 ++------
 .../camel/component/gridfs/QueryStrategy.java   | 25 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/dc7ed4d4/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
index bfce711..6df4391 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsConsumer.java
@@ -31,7 +31,6 @@ import com.mongodb.util.JSON;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.component.gridfs.GridFsEndpoint.QueryStrategy;
 import org.apache.camel.impl.DefaultConsumer;
 
 /**

http://git-wip-us.apache.org/repos/asf/camel/blob/dc7ed4d4/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
index 13aa862..cb8f686 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
@@ -38,14 +38,8 @@ import org.slf4j.LoggerFactory;
  */
 @UriEndpoint(scheme = "gridfs", title = "MongoDBGridFS", syntax = "gridfs:connectionBean", label = "database,nosql")
 public class GridFsEndpoint extends DefaultEndpoint {
-    
-    public enum QueryStrategy {
-        TimeStamp,
-        PersistentTimestamp,
-        FileAttribute,
-        TimeStampAndFileAttribute,
-        PersistentTimestampAndFileAttribute
-    };
+
+    ;
     public static final String GRIDFS_OPERATION = "gridfs.operation";
     public static final String GRIDFS_METADATA = "gridfs.metadata";
     public static final String GRIDFS_CHUNKSIZE = "gridfs.chunksize";

http://git-wip-us.apache.org/repos/asf/camel/blob/dc7ed4d4/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java
new file mode 100644
index 0000000..9b29f2a
--- /dev/null
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/QueryStrategy.java
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.gridfs;
+
+public enum QueryStrategy {
+    TimeStamp,
+    PersistentTimestamp,
+    FileAttribute,
+    TimeStampAndFileAttribute,
+    PersistentTimestampAndFileAttribute
+}


[13/16] camel git commit: Polished

Posted by da...@apache.org.
Polished


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

Branch: refs/heads/camel-2.18.x
Commit: 896b435112075163755bdc53c2799d31c3fd0591
Parents: f059f9d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:22:40 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:11:49 2016 +0100

----------------------------------------------------------------------
 .../camel/component/mina2/Mina2SslContextParametersTcpTest.java | 5 ++---
 .../camel/component/mina2/Mina2SslContextParametersVmTest.java  | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/896b4351/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
index fbb0bac..9752d5b 100644
--- a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
+++ b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersTcpTest.java
@@ -31,8 +31,7 @@ public class Mina2SslContextParametersTcpTest extends BaseMina2Test {
         Object body = "Hello there!";
         endpoint.expectedBodiesReceived(body);
 
-        template.sendBodyAndHeader(String.format("mina2:tcp://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters",
-                getPort()), body, "cheese", 123);
+        template.sendBodyAndHeader("mina2:tcp://localhost:" + getPort() + "?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", body, "cheese", 123);
 
         assertMockEndpointsSatisfied();
     }
@@ -46,7 +45,7 @@ public class Mina2SslContextParametersTcpTest extends BaseMina2Test {
         return new RouteBuilder() {
 
             public void configure() {
-                fromF("mina2:tcp://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
+                fromF("mina2:tcp://localhost:%s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
                         .to("log:before?showAll=true")
                         .to("mock:result").to("log:after?showAll=true");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/896b4351/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
index 21b53bb..649a32d 100644
--- a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
+++ b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2SslContextParametersVmTest.java
@@ -31,8 +31,7 @@ public class Mina2SslContextParametersVmTest extends BaseMina2Test {
         Object body = "Hello there!";
         endpoint.expectedBodiesReceived(body);
 
-        template.sendBodyAndHeader(String.format("mina2:vm://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters",
-                getPort()), body, "cheese", 123);
+        template.sendBodyAndHeader("mina2:vm://localhost:" + getPort() + "?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", body, "cheese", 123);
 
         assertMockEndpointsSatisfied();
     }
@@ -46,7 +45,7 @@ public class Mina2SslContextParametersVmTest extends BaseMina2Test {
         return new RouteBuilder() {
 
             public void configure() {
-                fromF("mina2:vm://localhost:%1$s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
+                fromF("mina2:vm://localhost:%s?sync=false&minaLogger=true&sslContextParameters=#sslContextParameters", getPort())
                         .to("log:before?showAll=true").to("mock:result")
                         .to("log:after?showAll=true");
             }


[06/16] camel git commit: Fixed invalid component json schema discovered by mvn camel:validate

Posted by da...@apache.org.
Fixed invalid component json schema discovered by mvn camel:validate


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

Branch: refs/heads/master
Commit: ecb7d5d4c88cac0d3cd616ddd946579b0a36bf07
Parents: 20f2b97
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:31:08 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:31:08 2016 +0100

----------------------------------------------------------------------
 .../src/main/docs/etcd-component.adoc           | 17 ++++-
 .../etcd/AbstractEtcdPollingConsumer.java       |  2 +-
 .../etcd/AbstractEtcdPollingEndpoint.java       | 69 ++++++++++++++++++++
 .../component/etcd/AbstractEtcdProducer.java    |  3 +-
 .../camel/component/etcd/EtcdStatsEndpoint.java |  2 +-
 .../camel/component/etcd/EtcdStatsTest.java     |  6 +-
 .../camel/component/etcd/EtcdWatchTest.java     |  2 +-
 7 files changed, 93 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/main/docs/etcd-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/docs/etcd-component.adoc b/components/camel-etcd/src/main/docs/etcd-component.adoc
index 6e6a35e..0cbfaf1 100644
--- a/components/camel-etcd/src/main/docs/etcd-component.adoc
+++ b/components/camel-etcd/src/main/docs/etcd-component.adoc
@@ -13,7 +13,7 @@
 
 
 // endpoint options: START
-The etcd component supports 16 endpoint options which are listed below:
+The etcd component supports 31 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
@@ -27,11 +27,26 @@ The etcd component supports 16 endpoint options which are listed below:
 | uris | common | http://localhost:2379,http://localhost:4001 | String | To set the URIs the client connects.
 | 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.
 | sendEmptyExchangeOnTimeout | consumer | false | boolean | To send an empty message in case of timeout watching for a key.
+| 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.
 | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
 | fromIndex | consumer (advanced) | 0 | Long | The index to watch from
+| pollStrategy | consumer (advanced) |  | PollingConsumerPollStrategy | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.
 | timeToLive | producer |  | Integer | To set the lifespan of a key in milliseconds.
 | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| backoffErrorThreshold | scheduler |  | int | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
+| backoffIdleThreshold | scheduler |  | int | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
+| backoffMultiplier | scheduler |  | int | To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.
+| delay | scheduler | 500 | long | Milliseconds before the next poll. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| greedy | scheduler | false | boolean | If greedy is enabled then the ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages.
+| initialDelay | scheduler | 1000 | long | Milliseconds before the first poll starts. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| runLoggingLevel | scheduler | TRACE | LoggingLevel | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.
+| scheduledExecutorService | scheduler |  | ScheduledExecutorService | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.
+| scheduler | scheduler | none | ScheduledPollConsumerScheduler | To use a cron scheduler from either camel-spring or camel-quartz2 component
+| schedulerProperties | scheduler |  | Map | To configure additional properties when using a custom scheduler or any of the Quartz2 Spring based scheduler.
+| startScheduler | scheduler | true | boolean | Whether the scheduler should be auto started.
+| timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay and delay options.
+| useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
 | password | security |  | String | The password to use for basic authentication.
 | sslContextParameters | security |  | SSLContextParameters | To configure security using SSLContextParameters.
 | userName | security |  | String | The user name to use for basic authentication.

http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
index 80ba445..b069c63 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingConsumer.java
@@ -30,7 +30,7 @@ public abstract class AbstractEtcdPollingConsumer extends ScheduledPollConsumer
 
     private EtcdClient client;
 
-    protected AbstractEtcdPollingConsumer(AbstractEtcdEndpoint endpoint, Processor processor, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
+    protected AbstractEtcdPollingConsumer(AbstractEtcdPollingEndpoint endpoint, Processor processor, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
         super(endpoint, processor);
 
         this.configuration = configuration;

http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java
new file mode 100644
index 0000000..f00996e
--- /dev/null
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdPollingEndpoint.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.etcd;
+
+import mousio.etcd4j.EtcdClient;
+import org.apache.camel.impl.DefaultPollingEndpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+
+/**
+ * The camel etcd component allows you to work with <a href="https://coreos.com/etcd">Etcd</a>, a distributed, A distributed, reliable key-value store.
+ */
+@UriEndpoint(scheme = "etcd", title = "etcd", syntax = "etcd:namespace/path", consumerClass = AbstractEtcdConsumer.class, label = "etcd")
+public abstract class AbstractEtcdPollingEndpoint extends DefaultPollingEndpoint {
+
+    @UriPath(description = "The API namespace to use", enums = "keys,stats,watch")
+    @Metadata(required = "true")
+    private final EtcdNamespace namespace;
+    @UriPath(description = "The path the enpoint refers to")
+    @Metadata(required = "false")
+    private final String path;
+    @UriParam
+    private final EtcdConfiguration configuration;
+
+    protected AbstractEtcdPollingEndpoint(String uri, EtcdComponent component, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
+        super(uri, component);
+
+        this.configuration = configuration;
+        this.namespace = namespace;
+        this.path = path;
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
+
+    public EtcdConfiguration getConfiguration() {
+        return this.configuration;
+    }
+
+    public EtcdNamespace getNamespace() {
+        return this.namespace;
+    }
+
+    public String getPath() {
+        return this.path;
+    }
+
+    public EtcdClient createClient() throws Exception {
+        return configuration.createClient();
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
index ab6a4ef..56d80e6 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/AbstractEtcdProducer.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.etcd;
 
 import mousio.etcd4j.EtcdClient;
+import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultProducer;
 
 /**
@@ -29,7 +30,7 @@ public abstract class AbstractEtcdProducer extends DefaultProducer {
 
     private EtcdClient client;
 
-    protected AbstractEtcdProducer(AbstractEtcdEndpoint endpoint, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
+    protected AbstractEtcdProducer(Endpoint endpoint, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {
         super(endpoint);
 
         this.configuration = configuration;

http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
index a081771..7bb41c2 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/EtcdStatsEndpoint.java
@@ -21,7 +21,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 
-public class EtcdStatsEndpoint extends AbstractEtcdEndpoint {
+public class EtcdStatsEndpoint extends AbstractEtcdPollingEndpoint {
 
     public EtcdStatsEndpoint(
         String uri, EtcdComponent component, EtcdConfiguration configuration, EtcdNamespace namespace, String path) {

http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
index 6af0148..b5dfb83 100644
--- a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
+++ b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdStatsTest.java
@@ -64,11 +64,11 @@ public class EtcdStatsTest extends EtcdTestSupport {
         return new RouteBuilder() {
             public void configure() {
                 // CONSUMER
-                from("etcd:stats/leader?consumer.delay=50&consumer.initialDelay=0")
+                from("etcd:stats/leader?delay=50&initialDelay=0")
                     .to("mock:stats-leader-consumer");
-                from("etcd:stats/self?consumer.delay=50&consumer.initialDelay=0")
+                from("etcd:stats/self?delay=50&initialDelay=0")
                     .to("mock:stats-self-consumer");
-                from("etcd:stats/store?consumer.delay=50&consumer.initialDelay=0")
+                from("etcd:stats/store?delay=50&initialDelay=0")
                     .to("mock:stats-store-consumer");
 
                 // PRODUCER

http://git-wip-us.apache.org/repos/asf/camel/blob/ecb7d5d4/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
----------------------------------------------------------------------
diff --git a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
index fad8687..3707bcf 100644
--- a/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
+++ b/components/camel-etcd/src/test/java/org/apache/camel/component/etcd/EtcdWatchTest.java
@@ -102,7 +102,7 @@ public class EtcdWatchTest extends EtcdTestSupport {
                 from("etcd:watch/myKey1")
                     .process(NODE_TO_VALUE_IN)
                     .to("mock:watch-with-path");
-                fromF("etcd:watch/myKeyRecovery?timeout=%d&fromIndex=%d", 1000 * 60 * 5, 1)
+                fromF("etcd:watch/myKeyRecovery?timeout=%s&fromIndex=%s", 1000 * 60 * 5, 1)
                     .id("watchRecovery")
                     .autoStartup(false)
                     .process(NODE_TO_VALUE_IN)


[16/16] camel git commit: Camel catalog - Should ignore validating uri parameters where the key is a placeholder and therefore not a known key name.

Posted by da...@apache.org.
Camel catalog - Should ignore validating uri parameters where the key is a placeholder and therefore not a known key name.


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

Branch: refs/heads/camel-2.18.x
Commit: 2e2a49eb32f51e794f9fd70bbd3d1705ac49ede2
Parents: dc7ed4d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 15:03:22 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 15:12:24 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/catalog/URISupport.java     | 14 ++++++++++++--
 .../org/apache/camel/catalog/CamelCatalogTest.java    | 12 ++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2e2a49eb/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java b/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
index 079426a..f61f0c0 100644
--- a/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
+++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/URISupport.java
@@ -230,7 +230,12 @@ public final class URISupport {
                 // the & denote parameter is ended
                 if (ch == '&') {
                     // parameter is ended, as we hit & separator
-                    addParameter(key.toString(), value.toString(), rc, useRaw || isRaw);
+                    String aKey = key.toString();
+                    // the key may be a placeholder of options which we then do not know what is
+                    boolean validKey = !aKey.startsWith("{{") && !aKey.endsWith("}}");
+                    if (validKey) {
+                        addParameter(aKey, value.toString(), rc, useRaw || isRaw);
+                    }
                     key.setLength(0);
                     value.setLength(0);
                     isKey = true;
@@ -249,7 +254,12 @@ public final class URISupport {
 
             // any left over parameters, then add that
             if (key.length() > 0) {
-                addParameter(key.toString(), value.toString(), rc, useRaw || isRaw);
+                String aKey = key.toString();
+                // the key may be a placeholder of options which we then do not know what is
+                boolean validKey = !aKey.startsWith("{{") && !aKey.endsWith("}}");
+                if (validKey) {
+                    addParameter(aKey, value.toString(), rc, useRaw || isRaw);
+                }
             }
 
             return rc;

http://git-wip-us.apache.org/repos/asf/camel/blob/2e2a49eb/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
index 271ca3f..85a6076 100644
--- a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
+++ b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
@@ -866,4 +866,16 @@ public class CamelCatalogTest {
         assertTrue(doc.contains("JSonPath language"));
     }
 
+    @Test
+    public void testValidateEndpointTwitterSpecial() throws Exception {
+        String uri = "twitter://search?{{%s}}&keywords=java";
+
+        EndpointValidationResult result = catalog.validateEndpointProperties(uri);
+        assertTrue(result.isSuccess());
+
+        uri = "twitter://search?{{%s}}";
+        result = catalog.validateEndpointProperties(uri);
+        assertTrue(result.isSuccess());
+    }
+
 }


[05/16] camel git commit: Add camel:validate

Posted by da...@apache.org.
Add camel:validate


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

Branch: refs/heads/master
Commit: 20f2b97f41b7a90e18aa709eeb8d473589a73b6f
Parents: ee10f61
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 8 14:22:58 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 8 14:22:58 2016 +0100

----------------------------------------------------------------------
 components/pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/20f2b97f/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 8ccc94e..61e6fe5 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -324,6 +324,7 @@
         <configuration>
           <failOnError>false</failOnError>
           <includeTest>true</includeTest>
+          <includeXml>true</includeXml>
           <ignoreLenientProperties>false</ignoreLenientProperties>
         </configuration>
       </plugin>