[2/2] camel git commit: Added test based on user forum issue

2015-12-14 Thread davsclaus
Added test based on user forum issue


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

Branch: refs/heads/camel-2.16.x
Commit: 54f1ea076d83912021df8fe27a9151ab993f1068
Parents: 618f8f7
Author: Claus Ibsen 
Authored: Mon Dec 14 10:19:24 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:19:42 2015 +0100

--
 .../sql/SqlProducerWhereIssueTest.java  | 84 
 1 file changed, 84 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/54f1ea07/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
--
diff --git 
a/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
new file mode 100644
index 000..bd41bb3
--- /dev/null
+++ 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
@@ -0,0 +1,84 @@
+/**
+ * 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.sql;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+
+public class SqlProducerWhereIssueTest extends CamelTestSupport {
+
+private EmbeddedDatabase db;
+
+@Before
+public void setUp() throws Exception {
+db = new EmbeddedDatabaseBuilder()
+
.setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
+
+super.setUp();
+}
+
+@After
+public void tearDown() throws Exception {
+super.tearDown();
+
+db.shutdown();
+}
+
+@Test
+public void testQueryWhereIssue() throws InterruptedException {
+MockEndpoint mock = getMockEndpoint("mock:query");
+mock.expectedMessageCount(1);
+
+template.requestBodyAndHeader("direct:query", "Hi there!", "lowId", 
"1");
+
+assertMockEndpointsSatisfied();
+
+List list = 
mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+Map row = (Map) list.get(0);
+assertEquals("ASF", row.get("LICENSE"));
+assertEquals(2, row.get("ROWCOUNT"));
+row = (Map) list.get(1);
+assertEquals("XXX", row.get("LICENSE"));
+assertEquals(1, row.get("ROWCOUNT"));
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+// required for the sql component
+getContext().getComponent("sql", 
SqlComponent.class).setDataSource(db);
+
+from("direct:query")
+.to("sql:select count(*) rowcount, license from projects 
where id=:#lowId or id=2 or id=3 group by license")
+.to("log:query")
+.to("mock:query");
+}
+};
+}
+}



[1/2] camel git commit: Added test based on user forum issue

2015-12-14 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 618f8f7fb -> 54f1ea076
  refs/heads/master 2f3b75bb4 -> c2c2cdd4e


Added test based on user forum issue


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

Branch: refs/heads/master
Commit: c2c2cdd4ec12ad0ca22bc2ac5317d866b74e7e44
Parents: 2f3b75b
Author: Claus Ibsen 
Authored: Mon Dec 14 10:19:24 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:19:24 2015 +0100

--
 .../sql/SqlProducerWhereIssueTest.java  | 84 
 1 file changed, 84 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c2c2cdd4/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
--
diff --git 
a/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
new file mode 100644
index 000..bd41bb3
--- /dev/null
+++ 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerWhereIssueTest.java
@@ -0,0 +1,84 @@
+/**
+ * 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.sql;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+
+public class SqlProducerWhereIssueTest extends CamelTestSupport {
+
+private EmbeddedDatabase db;
+
+@Before
+public void setUp() throws Exception {
+db = new EmbeddedDatabaseBuilder()
+
.setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
+
+super.setUp();
+}
+
+@After
+public void tearDown() throws Exception {
+super.tearDown();
+
+db.shutdown();
+}
+
+@Test
+public void testQueryWhereIssue() throws InterruptedException {
+MockEndpoint mock = getMockEndpoint("mock:query");
+mock.expectedMessageCount(1);
+
+template.requestBodyAndHeader("direct:query", "Hi there!", "lowId", 
"1");
+
+assertMockEndpointsSatisfied();
+
+List list = 
mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+Map row = (Map) list.get(0);
+assertEquals("ASF", row.get("LICENSE"));
+assertEquals(2, row.get("ROWCOUNT"));
+row = (Map) list.get(1);
+assertEquals("XXX", row.get("LICENSE"));
+assertEquals(1, row.get("ROWCOUNT"));
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+// required for the sql component
+getContext().getComponent("sql", 
SqlComponent.class).setDataSource(db);
+
+from("direct:query")
+.to("sql:select count(*) rowcount, license from projects 
where id=:#lowId or id=2 or id=3 group by license")
+.to("log:query")
+.to("mock:query");
+}
+};
+}
+}



[2/3] camel git commit: [CAMEL-9244] camel-paho - Endpoint must implement publishing of retained messages option

2015-12-14 Thread davsclaus
[CAMEL-9244] camel-paho - Endpoint must implement publishing of retained
messages option


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

Branch: refs/heads/master
Commit: 60920455f6c528decb74de442eb49c747312cf15
Parents: c2c2cdd
Author: gautric 
Authored: Fri Dec 11 21:15:40 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:59:32 2015 +0100

--
 .../camel/component/paho/PahoConstants.java |  4 
 .../camel/component/paho/PahoEndpoint.java  | 24 
 .../camel/component/paho/PahoProducer.java  |  2 ++
 3 files changed, 25 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/60920455/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
--
diff --git 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
index 8b6a932..9e45ae5 100644
--- 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
+++ 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
@@ -25,6 +25,10 @@ public final class PahoConstants {
  * Header indicating a topic of a MQTT message.
  */
 public static final String MQTT_TOPIC = "CamelMqttTopic";
+public static final String DEFAULT_BROKER_URL = "tcp://localhost:1883";
+public static final int DEFAULT_QOS = 2;
+public static final String DEFAULT_QOS_STRING = DEFAULT_QOS + "";
+public static final String DEFAULT_RETAINED_STRING = "false";
 
 @Deprecated
 public static final String HEADER_ORIGINAL_MESSAGE = "PahoOriginalMessage";

http://git-wip-us.apache.org/repos/asf/camel/blob/60920455/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
--
diff --git 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index 0527306..319ae15 100644
--- 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -40,17 +40,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.apache.camel.component.paho.PahoPersistence.MEMORY;
+import static org.apache.camel.component.paho.PahoConstants.DEFAULT_BROKER_URL;
+import static org.apache.camel.component.paho.PahoConstants.DEFAULT_QOS_STRING;
+import static org.apache.camel.component.paho.PahoConstants.DEFAULT_QOS;
+import static 
org.apache.camel.component.paho.PahoConstants.DEFAULT_RETAINED_STRING;
+
 
 @UriEndpoint(scheme = "paho", title = "Paho", consumerClass = 
PahoConsumer.class, label = "messaging", syntax = "paho:topic")
 public class PahoEndpoint extends DefaultEndpoint {
 
 private static final Logger LOG = 
LoggerFactory.getLogger(PahoEndpoint.class);
 
-// Constants
-private static final String DEFAULT_BROKER_URL = "tcp://localhost:1883";
-private static final int DEFAULT_QOS = 2;
-private static final String DEFAULT_QOS_STRING = DEFAULT_QOS + "";
-
 // Configuration members
 @UriPath @Metadata(required = "true")
 private String topic;
@@ -60,6 +60,8 @@ public class PahoEndpoint extends DefaultEndpoint {
 private String brokerUrl = DEFAULT_BROKER_URL;
 @UriParam(defaultValue = DEFAULT_QOS_STRING)
 private int qos = DEFAULT_QOS;
+@UriParam(defaultValue = DEFAULT_RETAINED_STRING)
+private boolean retained = false;
 @UriParam(defaultValue = "MEMORY")
 private PahoPersistence persistence = MEMORY;
 @UriParam(description = "Base directory used by file persistence.", 
defaultValue = "Current directory")
@@ -199,6 +201,18 @@ public class PahoEndpoint extends DefaultEndpoint {
 public void setQos(int qos) {
 this.qos = qos;
 }
+   
+public boolean isRetained() {
+   return retained;
+   }
+
+/**
+ * Retain option
+ * @param retained true/false
+ */
+   public void setRetained(boolean retained) {
+   this.retained = retained;
+   }
 
 // Auto-configuration getters & setters
 

http://git-wip-us.apache.org/repos/asf/camel/blob/60920455/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoProducer.java

[3/3] camel git commit: small typo correction

2015-12-14 Thread davsclaus
small typo correction


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

Branch: refs/heads/master
Commit: 0890e8f285bc12012243ceb8a44428727be059eb
Parents: 57b85fa
Author: gautric 
Authored: Mon Dec 14 10:57:46 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:59:33 2015 +0100

--
 .../main/java/org/apache/camel/component/paho/PahoConstants.java | 2 --
 .../main/java/org/apache/camel/component/paho/PahoEndpoint.java  | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/0890e8f2/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
--
diff --git 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
index 9e45ae5..453e6bc 100644
--- 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
+++ 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
@@ -27,8 +27,6 @@ public final class PahoConstants {
 public static final String MQTT_TOPIC = "CamelMqttTopic";
 public static final String DEFAULT_BROKER_URL = "tcp://localhost:1883";
 public static final int DEFAULT_QOS = 2;
-public static final String DEFAULT_QOS_STRING = DEFAULT_QOS + "";
-public static final String DEFAULT_RETAINED_STRING = "false";
 
 @Deprecated
 public static final String HEADER_ORIGINAL_MESSAGE = "PahoOriginalMessage";

http://git-wip-us.apache.org/repos/asf/camel/blob/0890e8f2/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
--
diff --git 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index c329c28..09665e1 100644
--- 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -52,9 +52,9 @@ public class PahoEndpoint extends DefaultEndpoint {
 private String clientId = "camel-" + System.nanoTime();
 @UriParam(defaultValue = PahoConstants.DEFAULT_BROKER_URL)
 private String brokerUrl = PahoConstants.DEFAULT_BROKER_URL;
-@UriParam(defaultValue = PahoConstants.DEFAULT_QOS_STRING)
+@UriParam(defaultValue = "2")
 private int qos = PahoConstants.DEFAULT_QOS;
-@UriParam(defaultValue = PahoConstants.DEFAULT_RETAINED_STRING)
+@UriParam(defaultValue = "false")
 private boolean retained;
 @UriParam(defaultValue = "MEMORY")
 private PahoPersistence persistence = PahoPersistence.MEMORY;



[1/3] camel git commit: CS validation with "mvn -Psourcecheck clean install"

2015-12-14 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/master c2c2cdd4e -> 0890e8f28


CS validation with "mvn -Psourcecheck clean install"


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

Branch: refs/heads/master
Commit: 57b85fa47ff5e0f53bd748a891f9980f53a17298
Parents: 6092045
Author: gautric 
Authored: Mon Dec 14 10:53:11 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:59:32 2015 +0100

--
 .../camel/component/paho/PahoEndpoint.java  | 48 +---
 1 file changed, 21 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/57b85fa4/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
--
diff --git 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index 319ae15..c329c28 100644
--- 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -18,8 +18,6 @@ package org.apache.camel.component.paho;
 
 import java.util.Set;
 
-import static java.lang.System.nanoTime;
-
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Exchange;
@@ -39,11 +37,6 @@ import 
org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.camel.component.paho.PahoPersistence.MEMORY;
-import static org.apache.camel.component.paho.PahoConstants.DEFAULT_BROKER_URL;
-import static org.apache.camel.component.paho.PahoConstants.DEFAULT_QOS_STRING;
-import static org.apache.camel.component.paho.PahoConstants.DEFAULT_QOS;
-import static 
org.apache.camel.component.paho.PahoConstants.DEFAULT_RETAINED_STRING;
 
 
 @UriEndpoint(scheme = "paho", title = "Paho", consumerClass = 
PahoConsumer.class, label = "messaging", syntax = "paho:topic")
@@ -52,18 +45,19 @@ public class PahoEndpoint extends DefaultEndpoint {
 private static final Logger LOG = 
LoggerFactory.getLogger(PahoEndpoint.class);
 
 // Configuration members
-@UriPath @Metadata(required = "true")
+@UriPath
+@Metadata(required = "true")
 private String topic;
 @UriParam
-private String clientId = "camel-" + nanoTime();
-@UriParam(defaultValue = DEFAULT_BROKER_URL)
-private String brokerUrl = DEFAULT_BROKER_URL;
-@UriParam(defaultValue = DEFAULT_QOS_STRING)
-private int qos = DEFAULT_QOS;
-@UriParam(defaultValue = DEFAULT_RETAINED_STRING)
-private boolean retained = false;
+private String clientId = "camel-" + System.nanoTime();
+@UriParam(defaultValue = PahoConstants.DEFAULT_BROKER_URL)
+private String brokerUrl = PahoConstants.DEFAULT_BROKER_URL;
+@UriParam(defaultValue = PahoConstants.DEFAULT_QOS_STRING)
+private int qos = PahoConstants.DEFAULT_QOS;
+@UriParam(defaultValue = PahoConstants.DEFAULT_RETAINED_STRING)
+private boolean retained;
 @UriParam(defaultValue = "MEMORY")
-private PahoPersistence persistence = MEMORY;
+private PahoPersistence persistence = PahoPersistence.MEMORY;
 @UriParam(description = "Base directory used by file persistence.", 
defaultValue = "Current directory")
 private String filePersistenceDirectory;
 
@@ -112,13 +106,13 @@ public class PahoEndpoint extends DefaultEndpoint {
 
 @Override
 public PahoComponent getComponent() {
-return (PahoComponent) super.getComponent();
+return (PahoComponent)super.getComponent();
 }
 
 // Resolvers
 
 protected MqttClientPersistence resolvePersistence() {
-if (persistence == MEMORY) {
+if (persistence ==  PahoPersistence.MEMORY) {
 return new MemoryPersistence();
 } else {
 if (filePersistenceDirectory != null) {
@@ -139,8 +133,7 @@ public class PahoEndpoint extends DefaultEndpoint {
 return connectOptions.iterator().next();
 } else if (connectOptions.size() > 1) {
 LOG.warn("Found {} instances of the MqttConnectOptions in the 
registry. None of these will be used by the endpoint. "
-+ "Please use 'connectOptions' endpoint option to 
select one.",
-connectOptions.size());
+ + "Please use 'connectOptions' endpoint option to select 
one.", connectOptions.size());
 }
 return new MqttConnectOptions();
 }

camel git commit: Added test based on user forum issue

2015-12-14 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/master d37ef3577 -> 2f3b75bb4


Added test based on user forum issue


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

Branch: refs/heads/master
Commit: 2f3b75bb46310d4a9c34cbd70448a46d814b0020
Parents: d37ef35
Author: Claus Ibsen 
Authored: Mon Dec 14 10:03:14 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:03:14 2015 +0100

--
 .../SqlProducerOutputHeaderWithQueryTest.java   | 74 
 1 file changed, 74 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/2f3b75bb/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
--
diff --git 
a/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
new file mode 100644
index 000..6d103f9
--- /dev/null
+++ 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
@@ -0,0 +1,74 @@
+/**
+ * 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.sql;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+
+public class SqlProducerOutputHeaderWithQueryTest extends CamelTestSupport {
+
+private EmbeddedDatabase db;
+
+@Before
+public void setUp() throws Exception {
+db = new EmbeddedDatabaseBuilder()
+
.setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
+
+super.setUp();
+}
+
+@After
+public void tearDown() throws Exception {
+super.tearDown();
+
+db.shutdown();
+}
+
+@Test
+public void testQueryOutputHeader() throws InterruptedException {
+MockEndpoint mock = getMockEndpoint("mock:query");
+mock.expectedMessageCount(1);
+mock.expectedHeaderReceived(SqlConstants.SQL_ROW_COUNT, 1);
+mock.expectedHeaderReceived("TheProjectID", 1);
+mock.message(0).body().isEqualTo("Hi there!");
+
+template.requestBodyAndHeader("direct:query", "Hi there!", 
"myProject", "Camel");
+
+assertMockEndpointsSatisfied();
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+// required for the sql component
+getContext().getComponent("sql", 
SqlComponent.class).setDataSource(db);
+
+from("direct:query")
+.to("sql:select id from projects where project = 
:#myProject?outputType=SelectOne=TheProjectID").to("mock:query");
+}
+};
+}
+}



camel git commit: Upgrade Deltaspike to version 1.5.2

2015-12-14 Thread acosentino
Repository: camel
Updated Branches:
  refs/heads/master c45c0b3c2 -> b0c314151


Upgrade Deltaspike to version 1.5.2


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

Branch: refs/heads/master
Commit: b0c3141511b17d23604725b23361ebde95353656
Parents: c45c0b3
Author: Andrea Cosentino 
Authored: Tue Dec 15 08:21:43 2015 +0100
Committer: Andrea Cosentino 
Committed: Tue Dec 15 08:21:43 2015 +0100

--
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/b0c31415/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index baae740..6d409b0 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -128,7 +128,7 @@
 [3.0,4.0)
 3.0.5
 3.0.5
-1.5.1
+1.5.2
 10.11.1.1
 3.3.2
 2.1.7



camel git commit: CAMEL-9418: camel-elasticsearch: make client.transport.sniff configurable

2015-12-14 Thread acosentino
Repository: camel
Updated Branches:
  refs/heads/master b0c314151 -> a16081995


CAMEL-9418: camel-elasticsearch: make client.transport.sniff configurable


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

Branch: refs/heads/master
Commit: a16081995df8b323cf85bcf4b96374169cac1b39
Parents: b0c3141
Author: Andrea Cosentino 
Authored: Tue Dec 15 08:43:35 2015 +0100
Committer: Andrea Cosentino 
Committed: Tue Dec 15 08:43:35 2015 +0100

--
 .../elasticsearch/ElasticsearchConfiguration.java| 15 ++-
 .../elasticsearch/ElasticsearchEndpoint.java |  6 +-
 .../elasticsearch/ElasticsearchIndexTest.java|  1 -
 3 files changed, 15 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/a1608199/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
--
diff --git 
a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
 
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
index 30656de..0f618f4 100644
--- 
a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
+++ 
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
@@ -49,6 +49,8 @@ public class ElasticsearchConfiguration {
 private String transportAddresses;
 @UriParam(defaultValue = "9300")
 private int port = ElasticsearchConstants.DEFAULT_PORT;
+@UriParam(defaultValue = "true")
+private Boolean clientTransportSniff = true;
 
 /**
  * Name of cluster or use local for local mode
@@ -149,7 +151,18 @@ public class ElasticsearchConfiguration {
 public void setPort(int port) {
 this.port = port;
 }
-   
+
+/**
+ * Is the client allowed to sniff the rest of the cluster or not (default 
true). This setting map to the client.transport.sniff setting.
+ */
+public Boolean getClientTransportSniff() {
+return clientTransportSniff;
+}
+
+public void setClientTransportSniff(Boolean clientTransportSniff) {
+this.clientTransportSniff = clientTransportSniff;
+}
+
 public boolean isLocal() {
 return local;
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/a1608199/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
--
diff --git 
a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
 
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
index ed12e40..18842b3 100644
--- 
a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
+++ 
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
@@ -108,14 +108,10 @@ public class ElasticsearchEndpoint extends 
DefaultEndpoint {
 
 private Settings getSettings() {
 return Settings.settingsBuilder()
-// setting the classloader here will allow the underlying 
elasticsearch-java
-// class to find its names.txt in an OSGi environment 
(otherwise the thread
-// classloader is used, which won't be able to see the file 
causing a startup
-// exception).
 .put("cluster.name", configuration.getClusterName())
 .put("client.transport.ignore_cluster_name", false)
 .put("node.client", true)
-.put("client.transport.sniff", true)
+.put("client.transport.sniff", 
configuration.getClientTransportSniff())
 .put("http.enabled", false)
 .build();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/a1608199/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
--
diff --git 
a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
 
b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
index 5563163..050d044 100644
--- 

camel git commit: Hive tests should be disabled on CI.

2015-12-14 Thread hekonsek
Repository: camel
Updated Branches:
  refs/heads/master 0890e8f28 -> 66600aa81


Hive tests should be disabled on CI.


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

Branch: refs/heads/master
Commit: 66600aa8107bfe499d4f9b35f81d185dea00377e
Parents: 0890e8f
Author: Henryk Konsek 
Authored: Mon Dec 14 20:55:53 2015 +0100
Committer: Henryk Konsek 
Committed: Mon Dec 14 20:55:53 2015 +0100

--
 .../java/org/apache/camel/component/spark/SparkProducerTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/66600aa8/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
--
diff --git 
a/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
 
b/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
index 44fc203..311d641 100644
--- 
a/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
+++ 
b/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.spark;
 import java.io.File;
 import java.io.IOException;
 
-import static java.lang.Runtime.getRuntime;
+import static java.lang.Boolean.parseBoolean;
 import static java.util.Arrays.asList;
 
 import com.google.common.truth.Truth;
@@ -46,7 +46,7 @@ public class SparkProducerTest extends CamelTestSupport {
 
 static JavaSparkContext sparkContext = createLocalSparkContext();
 
-static boolean shouldRunHive = getRuntime().maxMemory() > 2 * 1024 * 1024 
* 1024;
+static boolean shouldRunHive = 
parseBoolean(System.getenv("CAMEL_SPARK_HIVE_TESTS"));
 
 static HiveContext hiveContext;
 



svn commit: r975540 - in /websites/production/camel/content: apache-spark.html cache/main.pageCache

2015-12-14 Thread buildbot
Author: buildbot
Date: Mon Dec 14 20:19:25 2015
New Revision: 975540

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/apache-spark.html
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/apache-spark.html
==
--- websites/production/camel/content/apache-spark.html (original)
+++ websites/production/camel/content/apache-spark.html Mon Dec 14 20:19:25 2015
@@ -84,17 +84,17 @@

 
 
-Apache Spark componentApache Spark component is 
available starting from Camel 
2.17.This documentation page covers the http://spark.apache.org/;>Apache Spark 
component for the Apache Camel. The main purpose of the Spark integration with 
Camel is to provide a bridge between Camel connectors and Spark tasks. In 
particular Camel connector provides a way to route message from various 
transports, dynamically choose a task to execute, use incoming message as input 
data for that task and finally deliver the results of the execut
 ion back to the Camel pipeline.Supported architectural 
stylesSpark 
component can be used as a driver application deployed into an application 
server (or executed as a fat jar).https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" data
 -linked-resource-container-id="61331559" 
data-linked-resource-container-version="13">Spark component can also be submitted as a job directly into the Spark 
cluster.https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" 
data-linked-resource-container-id="61331559" data-linked-
 resource-container-version="13">While Spark component is primary 
designed to work as a long running jobserving as an bridge 
between Spark cluster and the other endpoints, you can also use it as a 
fire-once short job. Running Spark in OSGi 
serversCurrently the Spark component doesn't support execution 
in the OSGi container. Spark has been designed to be executed as a fat jar, 
usually submitted as a job to a cluster. For those reasons running Spark in an 
OSGi server is at least challenging and is not support by Camel as well.URI formatCurrently the Spark component 
supports only producers - it it intended to invoke a Spark job and return 
results. You can call RDD, data frame or Hive SQL 
job.Spark URI format
+Apache Spark componentApache Spark component is 
available starting from Camel 
2.17.This documentation page covers the http://spark.apache.org/;>Apache Spark 
component for the Apache Camel. The main purpose of the Spark integration with 
Camel is to provide a bridge between Camel connectors and Spark tasks. In 
particular Camel connector provides a way to route message from various 
transports, dynamically choose a task to execute, use incoming message as input 
data for that task and finally deliver the results of the execut
 ion back to the Camel pipeline.Supported architectural 
stylesSpark 
component can be used as a driver application deployed into an application 
server (or executed as a fat jar).https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" data
 -linked-resource-container-id="61331559" 
data-linked-resource-container-version="14">Spark component can also be submitted as a job directly into the Spark 
cluster.https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" 
data-linked-resource-container-id="61331559" data-linked-
 resource-container-version="14">While Spark component is primary 
designed to work as a long running jobserving as an bridge 
between Spark cluster and the other endpoints, you can also use it as a 
fire-once short job. Running Spark in OSGi 
serversCurrently the Spark component doesn't support execution 
in the OSGi container. Spark has been designed to be executed as a fat jar, 
usually submitted as a job to a cluster. For those reasons running Spark in an 
OSGi server is at least challenging and is not support by Camel as well.URI formatCurrently the Spark component 
supports only producers - it it intended to invoke a Spark job and return 
results. You can call RDD, data frame or Hive SQL 
job.Spark URI format
 
 RDD 
jobsTo invoke an RDD job, use the following 
URI:Spark 
RDD producer
 
-Where rdd option refers to the name of an 
RDD instance (subclass of 
org.apache.spark.api.java.AbstractJavaRDDLike) from a Camel 
registry, while rddCallback refers to the implementation 
oforg.apache.camel.component.spark.RddCallback class (also 
from a registry). RDD callback provides a single method used to apply incoming 
messages against the given RDD. Results of callback computations are saved as a 
body to an exchange.Spark RDD callback
+Where rdd option refers to the name of an 
RDD instance (subclass of 

camel git commit: Added Spark Hive collecting test.

2015-12-14 Thread hekonsek
Repository: camel
Updated Branches:
  refs/heads/master 66600aa81 -> c45c0b3c2


Added Spark Hive collecting test.


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

Branch: refs/heads/master
Commit: c45c0b3c2463d9902cc12f1a38630e0a482bbaa2
Parents: 66600aa
Author: Henryk Konsek 
Authored: Mon Dec 14 21:34:53 2015 +0100
Committer: Henryk Konsek 
Committed: Mon Dec 14 21:34:53 2015 +0100

--
 .../camel/component/spark/SparkProducerTest.java   | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c45c0b3c/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
--
diff --git 
a/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
 
b/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
index 311d641..11b6451 100644
--- 
a/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
+++ 
b/components/camel-spark/src/test/java/org/apache/camel/component/spark/SparkProducerTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.spark;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.List;
 
 import static java.lang.Boolean.parseBoolean;
 import static java.util.Arrays.asList;
@@ -30,6 +31,7 @@ import org.apache.spark.api.java.AbstractJavaRDDLike;
 import org.apache.spark.api.java.JavaRDD;
 import org.apache.spark.api.java.JavaSparkContext;
 import org.apache.spark.sql.DataFrame;
+import org.apache.spark.sql.Row;
 import org.apache.spark.sql.hive.HiveContext;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -221,8 +223,15 @@ public class SparkProducerTest extends CamelTestSupport {
 @Test
 public void shouldExecuteHiveQuery() {
 assumeTrue(shouldRunHive);
-long tablesCount = template.requestBody(sparkHiveUri + 
"?collect=false", "SELECT * FROM cars", Long.class);
-Truth.assertThat(tablesCount).isEqualTo(2);
+List cars = template.requestBody(sparkHiveUri, "SELECT * FROM 
cars", List.class);
+Truth.assertThat(cars.get(0).getString(1)).isEqualTo("X-trail");
+}
+
+@Test
+public void shouldExecuteHiveCountQuery() {
+assumeTrue(shouldRunHive);
+long carsCount = template.requestBody(sparkHiveUri + "?collect=false", 
"SELECT * FROM cars", Long.class);
+Truth.assertThat(carsCount).isEqualTo(2);
 }
 
 // Data frames tests



camel git commit: Added test based on user forum issue

2015-12-14 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 0105fec84 -> 618f8f7fb


Added test based on user forum issue


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

Branch: refs/heads/camel-2.16.x
Commit: 618f8f7fbf092691ac5808b1b304efd4e74fd274
Parents: 0105fec
Author: Claus Ibsen 
Authored: Mon Dec 14 10:03:14 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 10:03:54 2015 +0100

--
 .../SqlProducerOutputHeaderWithQueryTest.java   | 74 
 1 file changed, 74 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/618f8f7f/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
--
diff --git 
a/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
new file mode 100644
index 000..6d103f9
--- /dev/null
+++ 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerOutputHeaderWithQueryTest.java
@@ -0,0 +1,74 @@
+/**
+ * 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.sql;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+
+public class SqlProducerOutputHeaderWithQueryTest extends CamelTestSupport {
+
+private EmbeddedDatabase db;
+
+@Before
+public void setUp() throws Exception {
+db = new EmbeddedDatabaseBuilder()
+
.setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
+
+super.setUp();
+}
+
+@After
+public void tearDown() throws Exception {
+super.tearDown();
+
+db.shutdown();
+}
+
+@Test
+public void testQueryOutputHeader() throws InterruptedException {
+MockEndpoint mock = getMockEndpoint("mock:query");
+mock.expectedMessageCount(1);
+mock.expectedHeaderReceived(SqlConstants.SQL_ROW_COUNT, 1);
+mock.expectedHeaderReceived("TheProjectID", 1);
+mock.message(0).body().isEqualTo("Hi there!");
+
+template.requestBodyAndHeader("direct:query", "Hi there!", 
"myProject", "Camel");
+
+assertMockEndpointsSatisfied();
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+// required for the sql component
+getContext().getComponent("sql", 
SqlComponent.class).setDataSource(db);
+
+from("direct:query")
+.to("sql:select id from projects where project = 
:#myProject?outputType=SelectOne=TheProjectID").to("mock:query");
+}
+};
+}
+}



svn commit: r975477 - in /websites/production/camel/content: cache/main.pageCache camel-2170-release.html

2015-12-14 Thread buildbot
Author: buildbot
Date: Mon Dec 14 08:18:56 2015
New Revision: 975477

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-2170-release.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/camel-2170-release.html
==
--- websites/production/camel/content/camel-2170-release.html (original)
+++ websites/production/camel/content/camel-2170-release.html Mon Dec 14 
08:18:56 2015
@@ -85,7 +85,7 @@

 
 
-Camel 2.17.0 
release (currently in progress)http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; 
data-image-src="http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;>New and NoteworthyWelcome to 
the x.y.z release which approx XXX issues resolved (new features, improvements 
and bug fixes such as...)highlighted issue fixedUpgraded 
camel-hbase to Hadoop 2.x and HBase 1.1.xCamel commands forSpring BootMany improvements 
toCamel
 0;KuraAdded transacted option 
toSQL Component when used 
as a consumer in a transacted route.Added support for UPDATE operation 
toElasticSearch.Allow to reuse existing 
configured Elasticsearch Client on the ElasticSearch component, instead of creating a 
client per endpoint.Theinclude 
andexclude options onFile2 andFTP 
endpoints is now case in-sensitive out of the box.Resource based 
component such asXSLT,Velocityetc can load the resource 
file from theRegistryby 
usingref: as prefix.Upgraded camel-amqp to the latest 
qpid-jms-client (also AMQP  1.0 is not supported 
anymore).Many improvements to Camel AMQP component.TheMetrics Component allows to 
captureMessage History 
performance statistics with 
theMetricsMessageHistoryFactoryReduced 
the number of mbeans enlisted in the services tree, to only include mbeans that 
has value to be managed.TheElasticsearch Componentnow supports 
MultiGet operationFixed these issuesTheSwagger Java now parses nested types 
in the POJO model that has been annotated with the swagger api annotations to 
use in the schema api modelFixedRest DSL 
 >withapiContextPath fail to start if there are 2 ore more rest's in 
 >use.Paho component name is not limited to 4 characters 
 >anymore.FixedSpring 
 >Boot not starting Camel routes if running in Spring Cloud.id="Camel2.17.0Release-New">New href="enterprise-integration-patterns.html">Enterprise Integration 
 >PatternsNew href="components.html">Componentscamel-kubernetes - 
 >Integrates Camel with Kubernetescamel-aws - AWS kineses streams 
 >component addedNew DSLid="Camel2.17.0Release-NewAnnotations">New Annotationsid="Camel2.17.0Release-NewDataFormats">New href="data-format.html">Data Formatshref="mime-multipart.html">MIME-Multipart - mime
  based data format.New LanguagesNew Examplescamel-example-spring-boot-metrics 
- showing a Camel spring-boot application that report metrics to Graphite. 
Requires Graphite running on your network.New TutorialsAPI breakingKnown IssuesDependency 
upgradesEHCache from 2.10.0 to 2.10.1Mvel from 
2.2.6.Final to 2.2.7.FinalSpring 4.1.x to 4.2.xSpring-Boot 
1.2.x to 1.3.xSpring Integration 2.x to 4.xslf4j-api 1.6.x to 
1.7.xImportant 
changes to consider when upg
 radingRemoved camel-hbase as Karaf feature as it did not really 
work well in OSGicamel-infinispan requires Java 8.Support for 
Spring 4.0.x is deprecated.Moved some Camel tooling related 
dependencies (such as maven/plexus) from the Camel Parent BOM to the tooling 
BOM (to have them separated).camel-amqp do not support 0.9 
anymore.camel-spring-integration feature has been removed from 
the Camel karaf.Getting the 
DistributionsBinary 
DistributionsDescriptionDownload LinkPGP Signature file of downloadWin
 dows Distributionhttp://www.apache.org/dyn/closer.cgi/camel/apache-camel/x.y.x/apache-camel-x.y.x.zip;>apache-camel-x.y.x.ziphttp://www.apache.org/dist/camel/apache-camel/x.y.x/apache-camel-x.y.x.zip.asc;>apache-camel-x.y.x.zip.ascUnix/Linux/Cygwin 
Distributionhttp://www.apache.org/dyn/closer.cgi/camel/apache-camel/x.y.x/apache-camel-x.y.x.tar.gz;>apache-camel-x.y.x.tar.gzhttp://www.apache.org/dist/camel/apache-camel/x.y.x/apache-camel-x.y.x.tar.gz.asc;>apache-camel-x.y.x.tar.gz.asc
 The above URLs use 
redirectionThe above URLs use the Apache 
Mirror system to redirect you to a suitable mirror for your download. Some 
users have experienced issues with some versions of browsers (e.g. some Safari 
browsers). If the download doesn't seem to work for you from the above URL then 
try using http://www.mozilla.com/en-US/firefox/; 
rel="nofollow">FireFoxSource DistributionsDescriptionDownload Link
 PGP Signature file of 
downloadSource for 

svn commit: r975554 - in /websites/production/camel/content: apache-spark.html cache/main.pageCache

2015-12-14 Thread buildbot
Author: buildbot
Date: Mon Dec 14 21:19:46 2015
New Revision: 975554

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/apache-spark.html
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/apache-spark.html
==
--- websites/production/camel/content/apache-spark.html (original)
+++ websites/production/camel/content/apache-spark.html Mon Dec 14 21:19:46 2015
@@ -84,7 +84,7 @@

 
 
-Apache Spark componentApache Spark component is 
available starting from Camel 
2.17.This documentation page covers the http://spark.apache.org/;>Apache Spark 
component for the Apache Camel. The main purpose of the Spark integration with 
Camel is to provide a bridge between Camel connectors and Spark tasks. In 
particular Camel connector provides a way to route message from various 
transports, dynamically choose a task to execute, use incoming message as input 
data for that task and finally deliver the results of the execut
 ion back to the Camel pipeline.Supported architectural 
stylesSpark 
component can be used as a driver application deployed into an application 
server (or executed as a fat jar).https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" data
 -linked-resource-container-id="61331559" 
data-linked-resource-container-version="14">Spark component can also be submitted as a job directly into the Spark 
cluster.https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" 
data-linked-resource-container-id="61331559" data-linked-
 resource-container-version="14">While Spark component is primary 
designed to work as a long running jobserving as an bridge 
between Spark cluster and the other endpoints, you can also use it as a 
fire-once short job. Running Spark in OSGi 
serversCurrently the Spark component doesn't support execution 
in the OSGi container. Spark has been designed to be executed as a fat jar, 
usually submitted as a job to a cluster. For those reasons running Spark in an 
OSGi server is at least challenging and is not support by Camel as well.URI formatCurrently the Spark component 
supports only producers - it it intended to invoke a Spark job and return 
results. You can call RDD, data frame or Hive SQL 
job.Spark URI format
+Apache Spark componentApache Spark component is 
available starting from Camel 
2.17.This documentation page covers the http://spark.apache.org/;>Apache Spark 
component for the Apache Camel. The main purpose of the Spark integration with 
Camel is to provide a bridge between Camel connectors and Spark tasks. In 
particular Camel connector provides a way to route message from various 
transports, dynamically choose a task to execute, use incoming message as input 
data for that task and finally deliver the results of the execut
 ion back to the Camel pipeline.Supported architectural 
stylesSpark 
component can be used as a driver application deployed into an application 
server (or executed as a fat jar).https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" data
 -linked-resource-container-id="61331559" 
data-linked-resource-container-version="15">Spark component can also be submitted as a job directly into the Spark 
cluster.https://cwiki.apache.org/confluence; 
data-linked-resource-content-type="image/png" 
data-linked-resource-container-id="61331559" data-linked-
 resource-container-version="15">While Spark component is primary 
designed to work as a long running jobserving as an bridge 
between Spark cluster and the other endpoints, you can also use it as a 
fire-once short job. Running Spark in OSGi 
serversCurrently the Spark component doesn't support execution 
in the OSGi container. Spark has been designed to be executed as a fat jar, 
usually submitted as a job to a cluster. For those reasons running Spark in an 
OSGi server is at least challenging and is not support by Camel as well.URI formatCurrently the Spark component 
supports only producers - it it intended to invoke a Spark job and return 
results. You can call RDD, data frame or Hive SQL 
job.Spark URI format
 
 RDD 
jobsTo invoke an RDD job, use the following 
URI:Spark 
RDD producer
 
@@ -204,7 +204,19 @@ DataFrame cars(HiveContext hiveContext)
jsonCars.registerTempTable(cars);
return jsonCars;
 }]]>
-DataFrame 
jobs optionsOptionDescriptionDefault valuedataFrameDataFrame instance (subclass 
oforg.apache.spark.sql.DataFrame).nulldataFrameCallbackInstance 
oforg.apache.camel.component.spark.DataFrameCallbackinterface.null 
See Also
+DataFrame 
jobs optionsOptionDescriptionDefault valuedataFrameDataFrame instance (subclass 
oforg.apache.spark.sql.DataFrame).nulldataFrameCallbackInstance 

[2/2] camel git commit: CAMEL-9355: Reworked throttler implementation to be more performant and use a rolling window for time periods which gives a better flow. Thanks to Aaron Whiteside for the hard

2015-12-14 Thread davsclaus
CAMEL-9355: Reworked throttler implementation to be more performant and use a 
rolling window for time periods which gives a better flow. Thanks to Aaron 
Whiteside for the hard work and patch.


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

Branch: refs/heads/master
Commit: da5fa07bd36ff74250cffda0bd58b7d03a24a997
Parents: beab07a
Author: Claus Ibsen 
Authored: Mon Dec 14 09:12:21 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 09:48:34 2015 +0100

--
 .../management/mbean/ManagedThrottlerMBean.java |   3 -
 .../management/mbean/ManagedThrottler.java  |   4 -
 .../org/apache/camel/processor/Throttler.java   | 408 +--
 .../camel/management/ManagedThrottlerTest.java  |  38 --
 .../apache/camel/processor/ThrottlerTest.java   | 286 +
 5 files changed, 377 insertions(+), 362 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/da5fa07b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedThrottlerMBean.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedThrottlerMBean.java
 
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedThrottlerMBean.java
index 3bceae6..673c13e 100644
--- 
a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedThrottlerMBean.java
+++ 
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedThrottlerMBean.java
@@ -32,9 +32,6 @@ public interface ManagedThrottlerMBean extends 
ManagedProcessorMBean {
 @ManagedAttribute(description = "Time period in millis")
 void setTimePeriodMillis(long timePeriodMillis);
 
-@ManagedAttribute(description = "Number of exchanges currently throttled")
-int getThrottledCount();
-
 @ManagedAttribute(description = "Enables asynchronous delay which means 
the thread will not block while delaying")
 Boolean isAsyncDelayed();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/da5fa07b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedThrottler.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedThrottler.java
 
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedThrottler.java
index 0f49fb1..6c5e977 100644
--- 
a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedThrottler.java
+++ 
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedThrottler.java
@@ -56,10 +56,6 @@ public class ManagedThrottler extends ManagedProcessor 
implements ManagedThrottl
 throttler.setTimePeriodMillis(timePeriodMillis);
 }
 
-public int getThrottledCount() {
-return throttler.getDelayedCount();
-}
-
 public Boolean isAsyncDelayed() {
 return throttler.isAsyncDelayed();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/da5fa07b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
--
diff --git a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java 
b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
index 339da9d..dda02ec 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
@@ -16,8 +16,11 @@
  */
 package org.apache.camel.processor;
 
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.DelayQueue;
+import java.util.concurrent.Delayed;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.CamelContext;
@@ -27,7 +30,10 @@ import org.apache.camel.Processor;
 import org.apache.camel.RuntimeExchangeException;
 import org.apache.camel.Traceable;
 import org.apache.camel.spi.IdAware;
+import org.apache.camel.util.AsyncProcessorHelper;
 import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A http://camel.apache.org/throttler.html;>Throttler
@@ -38,20 +44,46 @@ import org.apache.camel.util.ObjectHelper;
  * particular system to malfunction or to reduce its throughput you might want
  * to introduce some throttling.
  *
+ * This throttle implementation is thread-safe and is therefore safe to be used
+ * by multiple concurrent threads in a single 

[1/2] camel git commit: CAMEL-9355: Reworked throttler implementation to be more performant and use a rolling window for time periods which gives a better flow. Thanks to Aaron Whiteside for the hard

2015-12-14 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/master beab07afc -> d37ef3577


CAMEL-9355: Reworked throttler implementation to be more performant and use a 
rolling window for time periods which gives a better flow. Thanks to Aaron 
Whiteside for the hard work and patch.


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

Branch: refs/heads/master
Commit: d37ef3577278a85ea2a77c6110921a5e85a73d5e
Parents: da5fa07
Author: Claus Ibsen 
Authored: Mon Dec 14 09:34:51 2015 +0100
Committer: Claus Ibsen 
Committed: Mon Dec 14 09:48:34 2015 +0100

--
 .../apache/camel/processor/ThrottlerTest.java   |  13 ---
 .../apache/camel/spring/processor/throttler.xml | 117 ++-
 2 files changed, 65 insertions(+), 65 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/d37ef357/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java 
b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
index 527c052..c0ae2f5 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
@@ -52,16 +52,6 @@ public class ThrottlerTest extends ContextTestSupport {
 resultEndpoint.assertIsSatisfied();
 }
 
-//public void testNoNestedProcessor() throws Exception {
-//if (!canTest()) {
-//return;
-//}
-//
-//MockEndpoint resultEndpoint = 
resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-//long elapsed = sendMessagesAndAwaitDelivery(MESSAGE_COUNT, 
"direct:noNestedProcessor", MESSAGE_COUNT, resultEndpoint);
-//assertThrottlerTiming(elapsed, 1, INTERVAL, MESSAGE_COUNT);
-//}
-
 public void testSendLotsOfMessagesWithRejectExecution() throws Exception {
 if (!canTest()) {
 return;
@@ -246,9 +236,6 @@ public class ThrottlerTest extends ContextTestSupport {
 
from("direct:start").throttle(2).timePeriodMillis(1).rejectExecution(true).to("log:result",
 "mock:result");
 
 
from("direct:highThrottleRate").throttle(1000).timePeriodMillis(INTERVAL).to("mock:result");
-
-//
from("direct:noNestedProcessor").throttle(1).timePeriodMillis(INTERVAL).end().to("log:result",
 "mock:result");
-
 }
 };
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/d37ef357/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
--
diff --git 
a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
 
b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
index 11f8791..e3fe328 100644
--- 
a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
+++ 
b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
@@ -22,62 +22,75 @@
http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
 ">
 
-http://camel.apache.org/schema/spring;>
-
-
org.apache.camel.processor.ThrottlerRejectedExecutionException
-true
-
-
+  http://camel.apache.org/schema/spring;>
+
+  
org.apache.camel.processor.ThrottlerRejectedExecutionException
+  
+true
+  
+  
+
 
-
-
-
-
-
-3
-
-
-
-
+
+
+  
+  
+  
+3
+
+
+  
+
+
 
-
-
-
-
-1
-
-
-
+
+  
+  
+  
+1
+
+
+  
+
 
-
-
-
-1
-
-
-
+
+  
+  
+1
+
+  
+
 
-
-
-
-
-
-throttleValue
-
-
-
-
-
-
-
-
-
-2
-
-
-
-
+
+
+  
+  
+
+throttleValue
+
+
+  
+
+
 
-
+
+  
+  
+  
+2