git commit: CAMEL-5286: More flexible onCompletion allow to configure mode before/after consumer. And whether to use async/sync with thread pool or not.
Repository: camel Updated Branches: refs/heads/master ee5550732 - 7f9ba0f04 CAMEL-5286: More flexible onCompletion allow to configure mode before/after consumer. And whether to use async/sync with thread pool or not. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7f9ba0f0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7f9ba0f0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7f9ba0f0 Branch: refs/heads/master Commit: 7f9ba0f04fe095871d32d6334c617d3ce14f2e82 Parents: ee55507 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 09:03:58 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 09:03:58 2014 +0200 -- .../java/org/apache/camel/processor/OnCompletionProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7f9ba0f0/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java index b3cf250..b925c29 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java @@ -114,8 +114,8 @@ public class OnCompletionProcessor extends ServiceSupport implements AsyncProces } protected boolean isCreateCopy() { -// we need to create a correlated copy if we run in parallel mode -return executorService != null; +// we need to create a correlated copy if we run in parallel mode or is in after consumer mode (as the UoW would be done on the original exchange otherwise) +return executorService != null || afterConsumer; } /**
git commit: Added more test to JsonPathCBRTest
Repository: camel Updated Branches: refs/heads/master 7f9ba0f04 - 1d3682d3f Added more test to JsonPathCBRTest Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1d3682d3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1d3682d3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1d3682d3 Branch: refs/heads/master Commit: 1d3682d3f030250ac8eb584d312f52dcd885dac1 Parents: 7f9ba0f Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 15:12:37 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 15:14:08 2014 +0800 -- .../apache/camel/jsonpath/JsonPathCBRTest.java| 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1d3682d3/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathCBRTest.java -- diff --git a/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathCBRTest.java b/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathCBRTest.java index 8638133..2720b56 100644 --- a/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathCBRTest.java +++ b/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathCBRTest.java @@ -18,6 +18,8 @@ package org.apache.camel.jsonpath; import java.io.File; +import org.apache.camel.builder.ExpressionBuilder; +import org.apache.camel.builder.PredicateBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; @@ -44,6 +46,13 @@ public class JsonPathCBRTest extends CamelTestSupport { .to(mock:cheap) .otherwise() .to(mock:expensive); + +from(direct:bicycle2) +.choice() + .when(PredicateBuilder.isLessThan(ExpressionBuilder.languageExpression(JsonPath, $.store.bicycle.price), ExpressionBuilder.constantExpression(20))) +.to(mock:cheap) +.otherwise() +.to(mock:expensive); } }; } @@ -56,11 +65,18 @@ public class JsonPathCBRTest extends CamelTestSupport { @Test public void testCheapBicycle() throws Exception { +sendMessageToBicycleRoute(direct:bicycle); +resetMocks(); +sendMessageToBicycleRoute(direct:bicycle2); + +} + +private void sendMessageToBicycleRoute(String startPoint) throws Exception { getMockEndpoint(mock:cheap).expectedMessageCount(1); getMockEndpoint(mock:average).expectedMessageCount(0); getMockEndpoint(mock:expensive).expectedMessageCount(0); -template.sendBody(direct:bicycle, new File(src/test/resources/cheap.json)); +template.sendBody(startPoint, new File(src/test/resources/cheap.json)); assertMockEndpointsSatisfied(); }
[2/2] git commit: CAMEL-7681 Fixed the CS errors
CAMEL-7681 Fixed the CS errors Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fb775276 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fb775276 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fb775276 Branch: refs/heads/master Commit: fb77527608ce0c3f862865183e8ec29c2f8075a4 Parents: cea796a Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 16:17:31 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 16:17:31 2014 +0800 -- .../elasticsearch/ElasticsearchConfiguration.java | 9 + .../component/elasticsearch/ElasticsearchProducer.java| 10 +- .../elasticsearch/ElasticsearchComponentTest.java | 10 +- 3 files changed, 15 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fb775276/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java -- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java index 1703d50..0c483bd 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java @@ -16,17 +16,18 @@ */ package org.apache.camel.component.elasticsearch; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Map; + import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriParams; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeBuilder; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Map; - import static org.elasticsearch.node.NodeBuilder.nodeBuilder; + @UriParams public class ElasticsearchConfiguration { http://git-wip-us.apache.org/repos/asf/camel/blob/fb775276/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java -- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java index 2d190b0..60b9c47 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java @@ -16,6 +16,10 @@ */ package org.apache.camel.component.elasticsearch; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + import org.apache.camel.Exchange; import org.apache.camel.ExpectedBodyTypeException; import org.apache.camel.Message; @@ -31,10 +35,6 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.xcontent.XContentBuilder; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - /** * Represents an Elasticsearch producer. */ @@ -145,7 +145,7 @@ public class ElasticsearchProducer extends DefaultProducer { log.debug(Preparing Bulk Request); BulkRequestBuilder bulkRequest = client.prepareBulk(); -List? body = exchange.getIn().getBody(List.class);; +List? body = exchange.getIn().getBody(List.class); for (Object document : body) { IndexRequestBuilder prepareIndex = client.prepareIndex(indexName, indexType); http://git-wip-us.apache.org/repos/asf/camel/blob/fb775276/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchComponentTest.java -- diff --git a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchComponentTest.java b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchComponentTest.java index d1e9945..7e96c93 100644 --- a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchComponentTest.java +++ b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchComponentTest.java @@ -16,6 +16,11 @@ */ package org.apache.camel.component.elasticsearch; +import java.util.ArrayList; +import java.util.HashMap;
[1/2] git commit: Fix CAMEL-7681 : Add Bulk Index mode to Elasticsearch component Add BULK_INDEX method Add unit test that index 2 Map in a row
Repository: camel Updated Branches: refs/heads/master 1d3682d3f - fb7752760 Fix CAMEL-7681 : Add Bulk Index mode to Elasticsearch component Add BULK_INDEX method Add unit test that index 2 Map in a row Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cea796a7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cea796a7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cea796a7 Branch: refs/heads/master Commit: cea796a78e1e5b50c6342a46c4ca2913214c7a85 Parents: 1d3682d Author: sebbrousse seb.brou...@gmail.com Authored: Mon Aug 11 23:15:52 2014 +0200 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 15:52:16 2014 +0800 -- .../ElasticsearchConfiguration.java | 10 ++- .../elasticsearch/ElasticsearchProducer.java| 83 .../ElasticsearchComponentTest.java | 24 +- 3 files changed, 96 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/cea796a7/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java -- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java index e1e8aa6..1703d50 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java @@ -16,14 +16,15 @@ */ package org.apache.camel.component.elasticsearch; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Map; - import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriParams; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeBuilder; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Map; + import static org.elasticsearch.node.NodeBuilder.nodeBuilder; @UriParams @@ -31,6 +32,7 @@ public class ElasticsearchConfiguration { public static final String PARAM_OPERATION = operation; public static final String OPERATION_INDEX = INDEX; +public static final String OPERATION_BULK_INDEX = BULK_INDEX; public static final String OPERATION_GET_BY_ID = GET_BY_ID; public static final String OPERATION_DELETE = DELETE; public static final String PARAM_INDEX_ID = indexId; http://git-wip-us.apache.org/repos/asf/camel/blob/cea796a7/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java -- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java index 3df10a2..2d190b0 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java @@ -16,13 +16,14 @@ */ package org.apache.camel.component.elasticsearch; -import java.util.Map; - import org.apache.camel.Exchange; import org.apache.camel.ExpectedBodyTypeException; import org.apache.camel.Message; import org.apache.camel.impl.DefaultProducer; import org.elasticsearch.action.ListenableActionFuture; +import org.elasticsearch.action.bulk.BulkItemResponse; +import org.elasticsearch.action.bulk.BulkRequestBuilder; +import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.index.IndexRequestBuilder; @@ -30,6 +31,10 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.xcontent.XContentBuilder; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + /** * Represents an Elasticsearch producer. */ @@ -62,6 +67,8 @@ public class ElasticsearchProducer extends DefaultProducer { getById(client, exchange); } else if (operation.equalsIgnoreCase(ElasticsearchConfiguration.OPERATION_DELETE)) { deleteById(client, exchange); +} else if (operation.equalsIgnoreCase(ElasticsearchConfiguration.OPERATION_BULK_INDEX)) { +addToIndexUsingBulk(client, exchange); } else { throw new
[1/4] git commit: CAMEL-7691: camel-serlvet - Potential NPE if no servlet name configured for osgi
Repository: camel Updated Branches: refs/heads/camel-2.12.x 13b5793f7 - 7507c4928 refs/heads/camel-2.13.x 9a4eb50ff - 82a54b5fb refs/heads/master fb7752760 - 0d842d123 CAMEL-7691: camel-serlvet - Potential NPE if no servlet name configured for osgi Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/82a54b5f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/82a54b5f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/82a54b5f Branch: refs/heads/camel-2.13.x Commit: 82a54b5fb8eae8d515e4dc0084f17f81b99b8a7c Parents: 9a4eb50 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 10:25:17 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 10:31:13 2014 +0200 -- .../servlet/osgi/OsgiServletRegisterer.java | 28 ++-- 1 file changed, 20 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/82a54b5f/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java -- diff --git a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java index 6c786ad..429f9e5 100644 --- a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java +++ b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java @@ -20,6 +20,7 @@ import java.util.Dictionary; import java.util.Hashtable; import javax.servlet.http.HttpServlet; +import org.apache.camel.util.ObjectHelper; import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; @@ -38,8 +39,11 @@ public class OsgiServletRegisterer { * of the form / is used to denote the root alias. */ private String alias; - -private String servletName; + +/** + * The servlet name. + */ +private String servletName = CamelServlet; /** * Servlet to be registered @@ -47,14 +51,16 @@ public class OsgiServletRegisterer { private HttpServlet servlet; /** - * HttpService to register with. Get this with osgi:reference in the spring - * context + * HttpService to register with. Get this with osgi:reference in the blueprint/spring-dm file */ private HttpService httpService; private HttpContext httpContext; private boolean alreadyRegistered; + +// The servlet will default have to match on uri prefix as some endpoints may do so +private volatile boolean matchOnUriPrefix = true; public void setHttpService(HttpService httpService) { this.httpService = httpService; @@ -75,14 +81,20 @@ public class OsgiServletRegisterer { public void setHttpContext(HttpContext httpContext) { this.httpContext = httpContext; } - + +public void setMatchOnUriPrefix(boolean matchOnUriPrefix) { +this.matchOnUriPrefix = matchOnUriPrefix; +} + public void register() throws Exception { -HttpContext actualHttpContext = (httpContext == null) +ObjectHelper.notEmpty(alias, alias, this); +ObjectHelper.notEmpty(servletName, servletName, this); + +HttpContext actualHttpContext = (httpContext == null) ? httpService.createDefaultHttpContext() : httpContext; final DictionaryString, String initParams = new HashtableString, String(); -// The servlet will always have to match on uri prefix as some endpoints may do so -initParams.put(matchOnUriPrefix, true); +initParams.put(matchOnUriPrefix, matchOnUriPrefix ? true : false); initParams.put(servlet-name, servletName); httpService.registerServlet(alias, servlet, initParams, actualHttpContext); alreadyRegistered = true;
[2/4] git commit: CAMEL-7691: camel-serlvet - Potential NPE if no servlet name configured for osgi
CAMEL-7691: camel-serlvet - Potential NPE if no servlet name configured for osgi Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7507c492 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7507c492 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7507c492 Branch: refs/heads/camel-2.12.x Commit: 7507c4928e937122d679fdfecbc15f02f7060024 Parents: 13b5793 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 10:25:17 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 10:31:29 2014 +0200 -- .../servlet/osgi/OsgiServletRegisterer.java | 28 ++-- 1 file changed, 20 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7507c492/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java -- diff --git a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java index 6c786ad..429f9e5 100644 --- a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java +++ b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java @@ -20,6 +20,7 @@ import java.util.Dictionary; import java.util.Hashtable; import javax.servlet.http.HttpServlet; +import org.apache.camel.util.ObjectHelper; import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; @@ -38,8 +39,11 @@ public class OsgiServletRegisterer { * of the form / is used to denote the root alias. */ private String alias; - -private String servletName; + +/** + * The servlet name. + */ +private String servletName = CamelServlet; /** * Servlet to be registered @@ -47,14 +51,16 @@ public class OsgiServletRegisterer { private HttpServlet servlet; /** - * HttpService to register with. Get this with osgi:reference in the spring - * context + * HttpService to register with. Get this with osgi:reference in the blueprint/spring-dm file */ private HttpService httpService; private HttpContext httpContext; private boolean alreadyRegistered; + +// The servlet will default have to match on uri prefix as some endpoints may do so +private volatile boolean matchOnUriPrefix = true; public void setHttpService(HttpService httpService) { this.httpService = httpService; @@ -75,14 +81,20 @@ public class OsgiServletRegisterer { public void setHttpContext(HttpContext httpContext) { this.httpContext = httpContext; } - + +public void setMatchOnUriPrefix(boolean matchOnUriPrefix) { +this.matchOnUriPrefix = matchOnUriPrefix; +} + public void register() throws Exception { -HttpContext actualHttpContext = (httpContext == null) +ObjectHelper.notEmpty(alias, alias, this); +ObjectHelper.notEmpty(servletName, servletName, this); + +HttpContext actualHttpContext = (httpContext == null) ? httpService.createDefaultHttpContext() : httpContext; final DictionaryString, String initParams = new HashtableString, String(); -// The servlet will always have to match on uri prefix as some endpoints may do so -initParams.put(matchOnUriPrefix, true); +initParams.put(matchOnUriPrefix, matchOnUriPrefix ? true : false); initParams.put(servlet-name, servletName); httpService.registerServlet(alias, servlet, initParams, actualHttpContext); alreadyRegistered = true;
[4/4] git commit: Polished
Polished Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0d842d12 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0d842d12 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0d842d12 Branch: refs/heads/master Commit: 0d842d123b637b15fddbb124219611eef53caf49 Parents: f070a83 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 10:25:44 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 10:31:39 2014 +0200 -- .../camel-example-servlet-rest-tomcat/pom.xml | 24 .../camel/example/rest/UserRouteBuilder.java| 5 2 files changed, 4 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0d842d12/examples/camel-example-servlet-rest-tomcat/pom.xml -- diff --git a/examples/camel-example-servlet-rest-tomcat/pom.xml b/examples/camel-example-servlet-rest-tomcat/pom.xml index 5804e59..3f68013 100755 --- a/examples/camel-example-servlet-rest-tomcat/pom.xml +++ b/examples/camel-example-servlet-rest-tomcat/pom.xml @@ -46,10 +46,11 @@ groupIdorg.apache.camel/groupId artifactIdcamel-servlet/artifactId /dependency + +!-- swagger api -- dependency groupIdorg.apache.camel/groupId artifactIdcamel-swagger/artifactId - version${project.version}/version /dependency !-- use for json binding -- @@ -64,23 +65,6 @@ artifactIdspring-web/artifactId /dependency -!-- swagger -- -dependency - groupIdcom.wordnik/groupId - artifactIdswagger-annotations/artifactId - version1.3.7/version -/dependency -dependency - groupIdcom.wordnik/groupId - artifactIdswagger-jaxrs_2.10/artifactId - version1.3.7/version -/dependency -dependency - groupIdcom.wordnik/groupId - artifactIdswagger-servlet_2.10/artifactId - version1.3.7/version -/dependency - !-- logging -- dependency groupIdlog4j/groupId @@ -94,19 +78,19 @@ groupIdch.qos.logback/groupId artifactIdlogback-classic/artifactId version1.0.13/version - scopecompile/scope /dependency dependency groupIdch.qos.logback/groupId artifactIdlogback-core/artifactId version1.0.13/version - scopecompile/scope /dependency /dependencies build +!-- we do not want version in the WAR name -- finalName${project.artifactId}/finalName +!-- allows running this example with mvn:jetty-run -- plugins plugin groupIdorg.eclipse.jetty/groupId http://git-wip-us.apache.org/repos/asf/camel/blob/0d842d12/examples/camel-example-servlet-rest-tomcat/src/main/java/org/apache/camel/example/rest/UserRouteBuilder.java -- diff --git a/examples/camel-example-servlet-rest-tomcat/src/main/java/org/apache/camel/example/rest/UserRouteBuilder.java b/examples/camel-example-servlet-rest-tomcat/src/main/java/org/apache/camel/example/rest/UserRouteBuilder.java index 0bcdf36..0f6fbd5 100644 --- a/examples/camel-example-servlet-rest-tomcat/src/main/java/org/apache/camel/example/rest/UserRouteBuilder.java +++ b/examples/camel-example-servlet-rest-tomcat/src/main/java/org/apache/camel/example/rest/UserRouteBuilder.java @@ -16,13 +16,8 @@ */ package org.apache.camel.example.rest; -import com.wordnik.swagger.config.SwaggerConfig; -import com.wordnik.swagger.model.ApiListing; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.swagger.RestSwaggerReader; import org.apache.camel.model.rest.RestBindingMode; -import org.apache.camel.model.rest.RestDefinition; -import scala.Option; /** * Define REST services using the Camel REST DSL
[3/4] git commit: CAMEL-7691: camel-serlvet - Potential NPE if no servlet name configured for osgi
CAMEL-7691: camel-serlvet - Potential NPE if no servlet name configured for osgi Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f070a83f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f070a83f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f070a83f Branch: refs/heads/master Commit: f070a83fa2f95ffa345b48b555cb7c8d7b6b8da7 Parents: fb77527 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 10:25:17 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 10:31:39 2014 +0200 -- .../servlet/osgi/OsgiServletRegisterer.java | 28 ++-- 1 file changed, 20 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/f070a83f/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java -- diff --git a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java index 6c786ad..429f9e5 100644 --- a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java +++ b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/osgi/OsgiServletRegisterer.java @@ -20,6 +20,7 @@ import java.util.Dictionary; import java.util.Hashtable; import javax.servlet.http.HttpServlet; +import org.apache.camel.util.ObjectHelper; import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; @@ -38,8 +39,11 @@ public class OsgiServletRegisterer { * of the form / is used to denote the root alias. */ private String alias; - -private String servletName; + +/** + * The servlet name. + */ +private String servletName = CamelServlet; /** * Servlet to be registered @@ -47,14 +51,16 @@ public class OsgiServletRegisterer { private HttpServlet servlet; /** - * HttpService to register with. Get this with osgi:reference in the spring - * context + * HttpService to register with. Get this with osgi:reference in the blueprint/spring-dm file */ private HttpService httpService; private HttpContext httpContext; private boolean alreadyRegistered; + +// The servlet will default have to match on uri prefix as some endpoints may do so +private volatile boolean matchOnUriPrefix = true; public void setHttpService(HttpService httpService) { this.httpService = httpService; @@ -75,14 +81,20 @@ public class OsgiServletRegisterer { public void setHttpContext(HttpContext httpContext) { this.httpContext = httpContext; } - + +public void setMatchOnUriPrefix(boolean matchOnUriPrefix) { +this.matchOnUriPrefix = matchOnUriPrefix; +} + public void register() throws Exception { -HttpContext actualHttpContext = (httpContext == null) +ObjectHelper.notEmpty(alias, alias, this); +ObjectHelper.notEmpty(servletName, servletName, this); + +HttpContext actualHttpContext = (httpContext == null) ? httpService.createDefaultHttpContext() : httpContext; final DictionaryString, String initParams = new HashtableString, String(); -// The servlet will always have to match on uri prefix as some endpoints may do so -initParams.put(matchOnUriPrefix, true); +initParams.put(matchOnUriPrefix, matchOnUriPrefix ? true : false); initParams.put(servlet-name, servletName); httpService.registerServlet(alias, servlet, initParams, actualHttpContext); alreadyRegistered = true;
[CONF] Apache Camel ElasticSearch
willem jiang edited the page: ElasticSearch Comment: CAMEL-7681 ... Maven users will need to add the following dependency to their pom.xml for this component: Code Block xml dependency groupIdorg.apache.camel/groupId artifactIdcamel-elasticsearch/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format Code Block elasticsearch://clusterName[?options] ... operation message body description INDEX Map, String, byte[] or XContentBuilder content to index adds content to an index and returns the content's indexId in the body
[CONF] Apache Camel Camel 2.14.0 Release
willem jiang edited the page: Camel 2.14.0 Release ... Support for running on Java 1.8 JVMs Spring 4.x supported. REST DSL to define REST services using a REST style with verbs such as get/post/put/delete etc. The Rest DSL supports Java and XML DSL. REST DSL integrated with Swagger to expose the service as swagger apis. Simple language defined in routes using resultType as boolean is now evaluated as predicate instead of as _expression_. Introduced RuntimeEndpointRegistry to capture runtime usage of endpoints in use during routing, such as dynamic endpoints from dynamic EIPs. Added event notification for routes added and removed. Allow to configure cache size in Recipient List, Routing Slip and Dynamic Router EIPs; and as well turn caching off. Netty HTTPproducer now supports the CamelHttpPath header to define a dynamic context-path and query parameters to call the remote http server. Polling Consumerallows to configure initial queue size and whether to block when full when using the defaultEventDrivenPollingConsumer which most components does. We now block by default, as otherwise the message may be lost if the queue was full, and a new message was offered. Added a generic callback to configure the APNS service builder. AddedStreamList option to theJDBC component Allow to define Simple expressions for sql parameters of the SQL component. A new XML tokenizer that is truly XML-aware (e.g., supporting XML namespaces and complex hierarchical structures) Added optionparallelAggregate to Multicast, Splitter and Recipient ListEIPs Support to set the variable map from message header in Velocity, Freemarker, StringTemplate. Added HazelcastInstance option toHazelcast component. Producers from static EIPs such as to is is now also enlisted in JMX when Camel is starting routes. Unmarshal json to pojo usingcamel-jackson now supports a header to tell Camel what the pojo class name is, to allow more dynamic behavior, as otherwise the class name would be hardcoded. Also allow to configurecamel-jackson to skip null values, by setting includes toNOT_NULL. Andcamel-jackson can now easily be configured to unmarshal to aListpojoor ListMapinstead of either a single pojo orMap type. IntroducedSynchronizationRouteAware allowing to have callbacks before/after an Exchange is being routed. This allows to trigger custom code at these points, for example after a route, but before a Consumer writes any response back to a caller (InOut mode). JDBCnow supports outputClass for SelectList type.
git commit: CAMEL-7690: Rest DSL - Added blueprint example.
Repository: camel Updated Branches: refs/heads/master 0d842d123 - b1c09a33a CAMEL-7690: Rest DSL - Added blueprint example. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b1c09a33 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b1c09a33 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b1c09a33 Branch: refs/heads/master Commit: b1c09a33a32809eeeca595176ea70313d4a2c850 Parents: 0d842d1 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 10:39:35 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 10:46:02 2014 +0200 -- .../README.txt | 63 ++ .../pom.xml | 104 ++ .../org/apache/camel/example/rest/User.java | 47 + .../apache/camel/example/rest/UserService.java | 63 ++ .../src/main/resources/META-INF/LICENSE.txt | 203 +++ .../src/main/resources/META-INF/NOTICE.txt | 11 + .../main/resources/OSGI-INF/blueprint/camel.xml | 80 .../src/main/resources/log4j.properties | 30 +++ examples/pom.xml| 1 + parent/pom.xml | 5 + 10 files changed, 607 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b1c09a33/examples/camel-example-servlet-rest-blueprint/README.txt -- diff --git a/examples/camel-example-servlet-rest-blueprint/README.txt b/examples/camel-example-servlet-rest-blueprint/README.txt new file mode 100644 index 000..1d78778 --- /dev/null +++ b/examples/camel-example-servlet-rest-blueprint/README.txt @@ -0,0 +1,63 @@ +Camel Servlet REST and OSGi Blueprint example += + +This example shows how to use Servlet REST to define REST endpoints in Camel routes using the Rest DSL + +This example is implemented in XML DSL in the `src/main/resources/OSGI-INF/bluepring/camel.xml` file. + +Apache Karaf / ServiceMix +- +You will need to compile this example first: + mvn compile + +To install Apache Camel in Karaf you type in the shell (we use version ${project.version}): + + features:chooseurl camel ${project.version} + features:install camel + +First you need to install the following features in Karaf/ServiceMix with: + + features:install camel-servlet + features:install camel-jackson + features:install war + +Then you can install the Camel example: + + osgi:install -s mvn:org.apache.camel/camel-example-servlet-rest-blueprintt/${project.version} + +And you can see the application running by tailing the logs + + log:tail + +And you can use ctrl + c to stop tailing the log. + + +There is a user REST service that supports the following operations + + - GET /user/{id} - to view a user with the given id /li + - GET /user/final - to view all users/li + - PUT /user - to update/create an user/li + +The view operations are HTTP GET, and update is using HTTP PUT. + +From a web browser you can access the first two services using the following links + + http://localhost:8181/camel-example-servlet-rest-blueprint/user/123- to view the user with id 123 + http://localhost:8181/camel-example-servlet-rest-blueprint/user/findAll - to list all users + + +From the command shell you can use curl to access the service as shown below: + +curl -X GET -H Accept: application/json http://localhost:8181/camel-example-servlet-rest-blueprint/user/123 +curl -X GET -H Accept: application/json http://localhost:8181/camel-example-servlet-rest-blueprint/user/findAll +curl -X PUT -d { \id\: 666, \name\: \The devil\} -H Accept: application/json http://localhost:8181/camel-example-servlet-rest-blueprint/user + + +If you hit any 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! http://git-wip-us.apache.org/repos/asf/camel/blob/b1c09a33/examples/camel-example-servlet-rest-blueprint/pom.xml -- diff --git a/examples/camel-example-servlet-rest-blueprint/pom.xml b/examples/camel-example-servlet-rest-blueprint/pom.xml new file mode 100755 index 000..2235245 --- /dev/null +++ b/examples/camel-example-servlet-rest-blueprint/pom.xml @@ -0,0 +1,104 @@ +?xml version=1.0 encoding=UTF-8? +!-- +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
svn commit: r919225 - in /websites/production/camel/content: cache/main.pageCache camel-2140-release.html elasticsearch.html
Author: buildbot Date: Wed Aug 13 09:17:55 2014 New Revision: 919225 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2140-release.html websites/production/camel/content/elasticsearch.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-2140-release.html == --- websites/production/camel/content/camel-2140-release.html (original) +++ websites/production/camel/content/camel-2140-release.html Wed Aug 13 09:17:55 2014 @@ -84,7 +84,7 @@ tbody tr td valign=top width=100% -div class=wiki-content maincontenth1 id=Camel2.14.0Release-Camel2.14.0release(currentlyinprogress)Camel 2.14.0 release (currently in progress)/h1div style=padding-right:20px;float:left;margin-left:-20px;pimg class=confluence-embedded-image confluence-external-resource src=http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; data-image-src=http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;/p/divdiv style=min-height:200px#160;/divh2 id=Camel2.14.0Release-NewandNoteworthyNew and Noteworthy/h2pWelcome to the 2.14.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)/pulliSupport for running on Java 1.8 JVMs/liliSpring 4.x supported./lilia shape=rect href=rest-dsl.htmlREST DSL/a to define REST services using a REST style with verbs such as get/post/put/delete etc. The Rest DSL supports Java and XML DSL./lilia shape=rect href=rest-dsl.htmlREST DSL /a integrated with a shape=rect href=swagger.htmlSwagger/a to expose the service as swagger apis./liliSimple language defined in routes using resultType as boolean is now evaluated as predicate instead of as expression./liliIntroduced RuntimeEndpointRegistry to capture runtime usage of endpoints in use during routing, such as dynamic endpoints from dynamic a shape=rect href=eip.htmlEIP/as./liliAdded event notification for routes added and removed./liliAllow to configure cache size in Recipient List, Routing Slip and Dynamic Router EIPs; and as well turn caching off./lilia shape=rect href=netty-http.htmlNetty HTTP/a#160;producer now supports the spanCamelHttpPath header to define a dynamic context-path and query parameters to call the remote http server./span/lilispana shape=rect href=polling-consumer.htmlPolling Consumer/a#160;allows to configure initial queue size and whether to block when full when using the default #160;codeEventDrivenPollingConsumer/code which most components does. We now block by default, as otherwise the message may be lost if the queue was full, and a new message was offered./span/lilispana shape=rect class=external-link href=https://issues.apache.org/jira/browse/CAMEL-7435;Added/a a generic callback to configure the a shape=rect href=apns.htmlAPNS/a service builder./span/lilispanAdded#160;codeStreamList/code option to the#160;a shape=rect href=jdbc.htmlJDBC/a component/span/liliAllow to define Simple expressions for sql parameters of the a shape=rect href=sql-component.htmlSQL/a component.spanbr clear=none/span/liliA new XML tokenizer that is truly XML-aware (e.g., supporting XML namespaces and complex hierarchical structures)/liliAdded option#160;codeparallelAggregate/code to a shape=rect href=multicast.htmlMulticast/a, a shape=rect href=splitter.htmlSplitter/a and a s hape=rect href=recipient-list.htmlRecipient List/a#160;EIPs/liliSupport to set the variable map from message header in a shape=rect href=velocity.htmlVelocity/a, a shape=rect href=freemarker.htmlFreemarker/a, a shape=rect href=stringtemplate.htmlStringTemplate/a./lilispanAdded HazelcastInstance option to#160;spana shape=rect href=hazelcast-component.htmlHazelcast/a component./span/span/liliProducers from static a shape=rect href=eip.htmlEIPs/a such as lt;togt; is is now also enlisted in a shape=rect href=camel-jmx.htmlJMX/a when Camel is starting routes./liliUnmarshal json to pojo using#160;codecamel-jackson/code now supports a header to tell Camel what the pojo class name is, to allow more dynamic behavior, as otherwise the class name would be hardcoded./liliAlso allow to configure#160;codecamel-jackson/code to skip null values, by setting includes to#160;codeNOT_NULL/code./lili And#160;codecamel-jackson/code can now easily be configured to unmarshal to a#160;codeListlt;pojogt;/code#160;or codeListlt;Mapgt;/code#160;instead of either a single pojo or#160;codeMap/code type.#160;/liliIntroduced#160;codeSynchronizationRouteAware/code allowing to have callbacks before/after an Exchange is being routed. This allows to trigger custom code at these points, for example after a route, but
git commit: Fixed camel-scala installing in osgi.
Repository: camel Updated Branches: refs/heads/master b1c09a33a - e7c9e405a Fixed camel-scala installing in osgi. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e7c9e405 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e7c9e405 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e7c9e405 Branch: refs/heads/master Commit: e7c9e405ad063727b89fb39069d63481e9935c76 Parents: b1c09a3 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 11:35:01 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 11:35:01 2014 +0200 -- components/camel-scala/pom.xml | 1 + platforms/karaf/features/src/main/resources/features.xml | 1 + 2 files changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e7c9e405/components/camel-scala/pom.xml -- diff --git a/components/camel-scala/pom.xml b/components/camel-scala/pom.xml index 22e444e..3dc21b6 100644 --- a/components/camel-scala/pom.xml +++ b/components/camel-scala/pom.xml @@ -31,6 +31,7 @@ properties camel.osgi.import.before.defaults +scala.xml.*;version=[1.0,2), scala.*;version=[2.11,2.12) /camel.osgi.import.before.defaults camel.osgi.export.pkgorg.apache.camel.scala.*/camel.osgi.export.pkg http://git-wip-us.apache.org/repos/asf/camel/blob/e7c9e405/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 7d3fc4f..18d4963 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -995,6 +995,7 @@ /feature feature name='camel-scala' version='${project.version}' resolver='(obr)' start-level='50' bundle dependency='true'mvn:org.scala-lang/scala-library/${scala-version}/bundle +bundle dependency='true'mvn:org.scala-lang.modules/scala-xml_2.11/${scalaxml-version}/bundle feature version='${project.version}'camel-core/feature bundlemvn:org.apache.camel/camel-scala/${project.version}/bundle /feature
[2/2] git commit: CAMEL-7654 Support Message attribute for the SQSProducer
CAMEL-7654 Support Message attribute for the SQSProducer Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2ca8187c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2ca8187c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2ca8187c Branch: refs/heads/master Commit: 2ca8187cf079b011b7f4438d803cd51c96378dc9 Parents: e7c9e40 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 16:58:21 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 17:49:50 2014 +0800 -- .../camel/component/aws/sqs/SqsEndpoint.java| 18 + .../camel/component/aws/sqs/SqsProducer.java| 24 +++ .../component/aws/sqs/SqsProducerTest.java | 72 3 files changed, 114 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2ca8187c/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java -- diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java index 6447d7b..b48fbe6 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java @@ -17,6 +17,7 @@ package org.apache.camel.component.aws.sqs; import java.util.HashMap; +import java.util.Map.Entry; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; @@ -27,6 +28,7 @@ import com.amazonaws.services.sqs.model.CreateQueueResult; import com.amazonaws.services.sqs.model.GetQueueUrlRequest; import com.amazonaws.services.sqs.model.GetQueueUrlResult; import com.amazonaws.services.sqs.model.ListQueuesResult; +import com.amazonaws.services.sqs.model.MessageAttributeValue; import com.amazonaws.services.sqs.model.QueueAttributeName; import com.amazonaws.services.sqs.model.SetQueueAttributesRequest; @@ -188,6 +190,12 @@ public class SqsEndpoint extends ScheduledPollEndpoint { message.setHeader(SqsConstants.RECEIPT_HANDLE, msg.getReceiptHandle()); message.setHeader(SqsConstants.ATTRIBUTES, msg.getAttributes()); message.setHeader(SqsConstants.MESSAGE_ATTRIBUTES, msg.getMessageAttributes()); + +//add all sqs message attributes as camel message headers so that knowledge of +//the Sqs class MessageAttributeValue will not leak to the client +for (EntryString, MessageAttributeValue entry : msg.getMessageAttributes().entrySet()) { +message.setHeader(entry.getKey(), translateValue(entry.getValue())); +} return exchange; } @@ -231,4 +239,14 @@ public class SqsEndpoint extends ScheduledPollEndpoint { public void setMaxMessagesPerPoll(int maxMessagesPerPoll) { this.maxMessagesPerPoll = maxMessagesPerPoll; } + +private Object translateValue(MessageAttributeValue mav) { +Object result = null; +if (mav.getStringValue() != null) { +result = mav.getStringValue(); +} else if (mav.getBinaryValue() != null) { +result = mav.getBinaryValue(); +} +return result; +} } http://git-wip-us.apache.org/repos/asf/camel/blob/2ca8187c/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java -- diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java index b4fa72b..0a4c948 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java @@ -16,7 +16,13 @@ */ package org.apache.camel.component.aws.sqs; +import java.nio.ByteBuffer; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + import com.amazonaws.services.sqs.AmazonSQS; +import com.amazonaws.services.sqs.model.MessageAttributeValue; import com.amazonaws.services.sqs.model.SendMessageRequest; import com.amazonaws.services.sqs.model.SendMessageResult; @@ -44,6 +50,7 @@ public class SqsProducer extends DefaultProducer { public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); SendMessageRequest request = new SendMessageRequest(getQueueUrl(), body); + request.setMessageAttributes(translateAttributes(exchange.getIn().getHeaders())); addDelay(request, exchange); LOG.trace(Sending
[1/2] git commit: CAMEL-7654 Supports Message Attribuets with HeaderFilterStrategy in AWS SQS component
Repository: camel Updated Branches: refs/heads/master e7c9e405a - 1e9878801 CAMEL-7654 Supports Message Attribuets with HeaderFilterStrategy in AWS SQS component Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1e987880 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1e987880 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1e987880 Branch: refs/heads/master Commit: 1e98788019bc1b4ebdd26fcbaa248ffa7a9715df Parents: 2ca8187 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 17:44:15 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 17:49:50 2014 +0800 -- .../camel/component/aws/sqs/SqsEndpoint.java| 27 ++-- .../aws/sqs/SqsHeaderFilterStrategy.java| 30 ++ .../camel/component/aws/sqs/SqsProducer.java| 33 +--- .../component/aws/sqs/SqsProducerTest.java | 8 +++-- 4 files changed, 81 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1e987880/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java -- diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java index b48fbe6..8ed85c5 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java @@ -31,7 +31,6 @@ import com.amazonaws.services.sqs.model.ListQueuesResult; import com.amazonaws.services.sqs.model.MessageAttributeValue; import com.amazonaws.services.sqs.model.QueueAttributeName; import com.amazonaws.services.sqs.model.SetQueueAttributesRequest; - import org.apache.camel.Consumer; import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; @@ -40,6 +39,8 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.impl.DefaultExchange; import org.apache.camel.impl.ScheduledPollEndpoint; +import org.apache.camel.spi.HeaderFilterStrategy; +import org.apache.camel.spi.HeaderFilterStrategyAware; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +50,7 @@ import org.slf4j.LoggerFactory; * Defines the a href=http://camel.apache.org/aws.html;AWS SQS Endpoint/a. * */ -public class SqsEndpoint extends ScheduledPollEndpoint { +public class SqsEndpoint extends ScheduledPollEndpoint implements HeaderFilterStrategyAware { private static final Logger LOG = LoggerFactory.getLogger(SqsEndpoint.class); @@ -57,12 +58,21 @@ public class SqsEndpoint extends ScheduledPollEndpoint { private String queueUrl; private SqsConfiguration configuration; private int maxMessagesPerPoll; +private HeaderFilterStrategy headerFilterStrategy; public SqsEndpoint(String uri, SqsComponent component, SqsConfiguration configuration) { super(uri, component); this.configuration = configuration; } + +public HeaderFilterStrategy getHeaderFilterStrategy() { +return headerFilterStrategy; +} +public void setHeaderFilterStrategy(HeaderFilterStrategy strategy) { +this.headerFilterStrategy = strategy; +} + public Producer createProducer() throws Exception { return new SqsProducer(this); } @@ -87,6 +97,11 @@ public class SqsEndpoint extends ScheduledPollEndpoint { if (ObjectHelper.isNotEmpty(getConfiguration().getAmazonSQSEndpoint())) { client.setEndpoint(getConfiguration().getAmazonSQSEndpoint()); } + +// check the setting the headerFilterStrategy +if (headerFilterStrategy == null) { +headerFilterStrategy = new SqsHeaderFilterStrategy(); +} // If both region and Account ID is provided the queue URL can be built manually. // This allows accessing queues where you don't have permission to list queues or query queues @@ -191,10 +206,16 @@ public class SqsEndpoint extends ScheduledPollEndpoint { message.setHeader(SqsConstants.ATTRIBUTES, msg.getAttributes()); message.setHeader(SqsConstants.MESSAGE_ATTRIBUTES, msg.getMessageAttributes()); +//Need to apply the SqsHeaderFilterStrategy this time +HeaderFilterStrategy headerFilterStrategy = getHeaderFilterStrategy(); //add all sqs message attributes as camel message headers so that knowledge of //the Sqs class MessageAttributeValue will not leak to the client for (EntryString, MessageAttributeValue entry :
[2/3] git commit: CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys
CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0007e186 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0007e186 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0007e186 Branch: refs/heads/camel-2.13.x Commit: 0007e18611664fdbf9995f21e142f032388617ae Parents: 82a54b5 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 12:00:33 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 12:00:51 2014 +0200 -- .../main/java/org/apache/camel/component/jdbc/JdbcProducer.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0007e186/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java -- diff --git a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java index 0446fb7..731fe51 100644 --- a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java +++ b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java @@ -189,6 +189,9 @@ public class JdbcProducer extends DefaultProducer { setResultSet(exchange, rs); } else { int updateCount = stmt.getUpdateCount(); +// preserve headers + exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders()); +// and then set the new header exchange.getOut().setHeader(JdbcConstants.JDBC_UPDATE_COUNT, updateCount); }
[1/3] git commit: CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys
Repository: camel Updated Branches: refs/heads/camel-2.12.x 7507c4928 - da0df82df refs/heads/camel-2.13.x 82a54b5fb - 0007e1861 refs/heads/master 1e9878801 - 6dc9d8a48 CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6dc9d8a4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6dc9d8a4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6dc9d8a4 Branch: refs/heads/master Commit: 6dc9d8a48c7fba85e5158b89b8394eb565dc1331 Parents: 1e98788 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 12:00:33 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 12:00:33 2014 +0200 -- .../main/java/org/apache/camel/component/jdbc/JdbcProducer.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6dc9d8a4/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java -- diff --git a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java index 3de77e9..d78e9c7 100644 --- a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java +++ b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java @@ -222,6 +222,9 @@ public class JdbcProducer extends DefaultProducer { shouldCloseResources = setResultSet(exchange, rs); } else { int updateCount = stmt.getUpdateCount(); +// preserve headers + exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders()); +// and then set the new header exchange.getOut().setHeader(JdbcConstants.JDBC_UPDATE_COUNT, updateCount); }
[3/3] git commit: CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys
CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/da0df82d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/da0df82d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/da0df82d Branch: refs/heads/camel-2.12.x Commit: da0df82dffd32a453419e628b78dc8166734dda3 Parents: 7507c49 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 12:00:33 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 12:00:58 2014 +0200 -- .../main/java/org/apache/camel/component/jdbc/JdbcProducer.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/da0df82d/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java -- diff --git a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java index 0446fb7..731fe51 100644 --- a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java +++ b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java @@ -189,6 +189,9 @@ public class JdbcProducer extends DefaultProducer { setResultSet(exchange, rs); } else { int updateCount = stmt.getUpdateCount(); +// preserve headers + exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders()); +// and then set the new header exchange.getOut().setHeader(JdbcConstants.JDBC_UPDATE_COUNT, updateCount); }
git commit: CAMEL-7354: Rest DSL. Integrate with camel-netty-http.
Repository: camel Updated Branches: refs/heads/master 6dc9d8a48 - 6fae19134 CAMEL-7354: Rest DSL. Integrate with camel-netty-http. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6fae1913 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6fae1913 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6fae1913 Branch: refs/heads/master Commit: 6fae1913455279019c2dbcdc1199ab8685feaeba Parents: 6dc9d8a Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 13:53:33 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 13:53:33 2014 +0200 -- .../netty/http/ContextPathMatcher.java | 26 +- .../netty/http/DefaultContextPathMatcher.java | 14 +++- .../netty/http/RestContextPathMatcher.java | 31 --- .../http/handlers/HttpServerChannelHandler.java | 4 + .../HttpServerMultiplexChannelHandler.java | 60 -- .../RestNettyHttpContextPathMatchGetTest.java | 68 .../netty/http/rest/RestPathMatchingTest.java | 86 7 files changed, 265 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6fae1913/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/ContextPathMatcher.java -- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/ContextPathMatcher.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/ContextPathMatcher.java index a3c02d8..df8498a 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/ContextPathMatcher.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/ContextPathMatcher.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.netty.http; +import java.util.Locale; + /** * A matcher used for selecting the correct {@link org.apache.camel.component.netty.http.handlers.HttpServerChannelHandler} * to handle an incoming {@link org.jboss.netty.handler.codec.http.HttpRequest} when you use multiple routes on the same @@ -27,11 +29,29 @@ package org.apache.camel.component.netty.http; public interface ContextPathMatcher { /** - * Whether the target context-path matches. + * Whether the target context-path matches a regular url. + * + * @param path the context-path from the incoming HTTP request + * @return tttrue/tt to match, ttfalse/tt if not. + */ +boolean matches(String path); + +/** + * Whether the target context-path matches a REST url. * - * @param method the HTTP method such as GET, POST * @param path the context-path from the incoming HTTP request + * @param wildcard whether to match strict or by wildcards * @return tttrue/tt to match, ttfalse/tt if not. */ -boolean matches(String method, String path); +boolean matchesRest(String path, boolean wildcard); + +/** + * Matches the given request HTTP method with the configured HTTP method of the consumer + * + * @param methodthe request HTTP method + * @param restrict the consumer configured HTTP restrict method + * @return tttrue/tt if matched, ttfalse/tt otherwise + */ +boolean matchMethod(String method, String restrict); + } http://git-wip-us.apache.org/repos/asf/camel/blob/6fae1913/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultContextPathMatcher.java -- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultContextPathMatcher.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultContextPathMatcher.java index e1a4d52..9f7d98f 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultContextPathMatcher.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultContextPathMatcher.java @@ -31,7 +31,8 @@ public class DefaultContextPathMatcher implements ContextPathMatcher { this.matchOnUriPrefix = matchOnUriPrefix; } -public boolean matches(String method, String path) { +@Override +public boolean matches(String path) { path = path.toLowerCase(Locale.US); if (!matchOnUriPrefix) { // exact match @@ -42,6 +43,17 @@ public class DefaultContextPathMatcher implements ContextPathMatcher { } } +@Override +public boolean matchesRest(String path, boolean wildcard) { +return false; +} + +@Override +public boolean matchMethod(String method, String
[CONF] Apache Camel Metrics Component
Lauri Kimmel created a page: Metrics Component Metrics Component Available as of Camel 2.14 Themetrics:component allows you to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of your application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-metrics/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format metrics:[ meter | counter | histogram | timer ]:metricname[?options] Metric Registry Camel Metrics Component uses by default MetricRegistry with Slf4jReporter and 60 second reporting interval. Default registry can be replaced with custom one by providing bean with name metricRegistry in Camel registry.For example using Spring Java Configuration. @Configuration public static class MyConfig extends SingleRouteCamelConfiguration { @Bean @Override public RouteBuilder route() { return new RouteBuilder() { @Override public void configure() throws Exception { // define Camel routes here } }; } @Bean(name = MetricsComponent.METRIC_REGISTRY_NAME) public MetricRegistry getMetricRegistry() { MetricRegistry registry = ...; return registry; } } Icon MetricRegistry uses internal thread(s) for reporting. There is no public API in version 3.0.1 for users to clean up on exit. Thus using Camel Metrics Component leads to Java classloader leak and my cause OutOfMemoryErrors in some cases. Usage Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default. Headers Metric name defined in URI can be overridden by using header with name CamelMetricsName. For example from(direct:in) .setHeader(MetricsConstants.HEADER_METRIC_NAME,
[CONF] Apache Camel Metrics Component
Lauri Kimmel edited the page: Metrics Component ... Themetrics:component allows you to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of your application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics. ... Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default. ... View Online Like View Changes Stop watching space Manage Notifications This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software
[CONF] Apache Camel Metrics Component
Lauri Kimmel edited the page: Metrics Component ... Themetrics:component allows to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of your application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics. ... Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default. ... View Online Like View Changes Stop watching space Manage Notifications This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software
[1/2] git commit: CAMEL-7619: Rest DSL - adding support for xml/json binding using Camel's data formats.
Repository: camel Updated Branches: refs/heads/master 6fae19134 - ac8c494f9 CAMEL-7619: Rest DSL - adding support for xml/json binding using Camel's data formats. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c9463733 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c9463733 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c9463733 Branch: refs/heads/master Commit: c946373342634fac83810d8aae5ea228dd573dd1 Parents: 6fae191 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 15:22:52 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 15:22:52 2014 +0200 -- .../processor/binding/RestBindingProcessor.java | 31 ++-- 1 file changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c9463733/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java index 7537a82..52ea190 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java @@ -44,6 +44,8 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess // TODO: consumes/produces can be a list of media types, and prioritized 1st to last. (eg the q=weight option) // TODO: use content-type from produces/consumes if possible to set as Content-Type if missing +// text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 + private final AsyncProcessor jsonUnmarshal; private final AsyncProcessor xmlUnmarshal; private final AsyncProcessor jsonMarshal; @@ -109,7 +111,8 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess boolean isXml = false; boolean isJson = false; -// content type takes precedence, over consumes +String accept = exchange.getIn().getHeader(Accept, String.class); + String contentType = ExchangeHelper.getContentType(exchange); if (contentType != null) { isXml = contentType.toLowerCase(Locale.US).contains(xml); @@ -156,7 +159,7 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess if (isXml xmlUnmarshal != null) { // add reverse operation -exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, true)); +exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, true, accept)); if (ObjectHelper.isNotEmpty(body)) { return xmlUnmarshal.process(exchange, callback); } else { @@ -165,7 +168,7 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess } } else if (isJson jsonUnmarshal != null) { // add reverse operation -exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, false)); +exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, false, accept)); if (ObjectHelper.isNotEmpty(body)) { return jsonUnmarshal.process(exchange, callback); } else { @@ -177,7 +180,7 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess // we could not bind if (bindingMode.equals(auto)) { // okay for auto we do not mind if we could not bind -exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, false)); +exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, false, accept)); callback.done(true); return true; } else { @@ -216,12 +219,14 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess private final AsyncProcessor xmlMarshal; private final String routeId; private boolean wasXml; +private String accept; -private RestBindingMarshalOnCompletion(String routeId, AsyncProcessor jsonMarshal, AsyncProcessor xmlMarshal, boolean wasXml) { +private RestBindingMarshalOnCompletion(String routeId, AsyncProcessor jsonMarshal, AsyncProcessor xmlMarshal, boolean wasXml, String accept) {
[2/2] git commit: CAMEL-7619: Rest DSL - adding support for xml/json binding using Camel's data formats.
CAMEL-7619: Rest DSL - adding support for xml/json binding using Camel's data formats. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ac8c494f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ac8c494f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ac8c494f Branch: refs/heads/master Commit: ac8c494f9f52858a45311334e5c1f04e063d4827 Parents: c946373 Author: Claus Ibsen davscl...@apache.org Authored: Wed Aug 13 15:35:10 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Aug 13 15:35:10 2014 +0200 -- .../processor/binding/RestBindingProcessor.java | 30 +++- 1 file changed, 16 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ac8c494f/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java index 52ea190..ec1af34 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/binding/RestBindingProcessor.java @@ -157,20 +157,21 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess } } -if (isXml xmlUnmarshal != null) { +// favor json over xml +if (isJson jsonUnmarshal != null) { // add reverse operation -exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, true, accept)); +exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, false, accept)); if (ObjectHelper.isNotEmpty(body)) { -return xmlUnmarshal.process(exchange, callback); +return jsonUnmarshal.process(exchange, callback); } else { callback.done(true); return true; } -} else if (isJson jsonUnmarshal != null) { +} else if (isXml xmlUnmarshal != null) { // add reverse operation -exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, false, accept)); +exchange.addOnCompletion(new RestBindingMarshalOnCompletion(exchange.getFromRouteId(), jsonMarshal, xmlMarshal, true, accept)); if (ObjectHelper.isNotEmpty(body)) { -return jsonUnmarshal.process(exchange, callback); +return xmlUnmarshal.process(exchange, callback); } else { callback.done(true); return true; @@ -302,20 +303,21 @@ public class RestBindingProcessor extends ServiceSupport implements AsyncProcess ExchangeHelper.prepareOutToIn(exchange); try { -if (isXml xmlMarshal != null) { -// make sure there is a content-type with xml -String type = ExchangeHelper.getContentType(exchange); -if (type == null) { -exchange.getIn().setHeader(Exchange.CONTENT_TYPE, application/xml); -} -xmlMarshal.process(exchange); -} else if (isJson jsonMarshal != null) { +// favor json over xml +if (isJson jsonMarshal != null) { // make sure there is a content-type with json String type = ExchangeHelper.getContentType(exchange); if (type == null) { exchange.getIn().setHeader(Exchange.CONTENT_TYPE, application/json); } jsonMarshal.process(exchange); +} else if (isXml xmlMarshal != null) { +// make sure there is a content-type with xml +String type = ExchangeHelper.getContentType(exchange); +if (type == null) { +exchange.getIn().setHeader(Exchange.CONTENT_TYPE, application/xml); +} +xmlMarshal.process(exchange); } else { // we could not bind if (bindingMode.equals(auto)) {
[CONF] Apache Camel Camel 2.14.0 Release
Lauri Kimmel edited the page: Camel 2.14.0 Release Comment: Linked camel-metrics ... camel-ahc-ws camel-atmosphere-websocket camel-box camel-dropbox camel-metrics camel-netty4 camel-openshift camel-gora camel-rest (in camel-core) camel-spark-rest camel-swagger ... View Online Like View Changes Stop watching space Manage Notifications This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software
git commit: CAMEL-7659 fixed the issue that camel-atom filter always returns the last consumed entry from feed more than once
Repository: camel Updated Branches: refs/heads/master ac8c494f9 - 25740b0e4 CAMEL-7659 fixed the issue that camel-atom filter always returns the last consumed entry from feed more than once Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/25740b0e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/25740b0e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/25740b0e Branch: refs/heads/master Commit: 25740b0e4a50aa6446b962871d64ef475326ac84 Parents: ac8c494 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 18:02:16 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 22:06:09 2014 +0800 -- .../java/org/apache/camel/component/atom/UpdatedDateFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/25740b0e/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java -- diff --git a/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java b/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java index 8a78a1d..f5067a5 100644 --- a/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java +++ b/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java @@ -50,7 +50,8 @@ public class UpdatedDateFilter implements EntryFilter { return true; } if (lastUpdate != null) { -if (lastUpdate.after(updated)) { +// we need to skip the latest updated entry +if (lastUpdate.after(updated) || lastUpdate.equals(updated)) { LOG.debug(Entry is older than lastupdate=[{}], no valid entry=[{}], lastUpdate, entry); return false; }
[1/2] git commit: CAMEL-7659 fixed the issue that camel-atom filter always returns the last consumed entry from feed more than once
Repository: camel Updated Branches: refs/heads/camel-2.12.x da0df82df - c0490006f refs/heads/camel-2.13.x 0007e1861 - a174e0d6e CAMEL-7659 fixed the issue that camel-atom filter always returns the last consumed entry from feed more than once Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a174e0d6 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a174e0d6 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a174e0d6 Branch: refs/heads/camel-2.13.x Commit: a174e0d6e38116799cc673e2cf7d023b7ae7dfd9 Parents: 0007e18 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 18:02:16 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 22:16:21 2014 +0800 -- .../java/org/apache/camel/component/atom/UpdatedDateFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a174e0d6/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java -- diff --git a/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java b/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java index 8a78a1d..f5067a5 100644 --- a/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java +++ b/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java @@ -50,7 +50,8 @@ public class UpdatedDateFilter implements EntryFilter { return true; } if (lastUpdate != null) { -if (lastUpdate.after(updated)) { +// we need to skip the latest updated entry +if (lastUpdate.after(updated) || lastUpdate.equals(updated)) { LOG.debug(Entry is older than lastupdate=[{}], no valid entry=[{}], lastUpdate, entry); return false; }
[2/2] git commit: CAMEL-7659 fixed the issue that camel-atom filter always returns the last consumed entry from feed more than once
CAMEL-7659 fixed the issue that camel-atom filter always returns the last consumed entry from feed more than once Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c0490006 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c0490006 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c0490006 Branch: refs/heads/camel-2.12.x Commit: c0490006f1a4a0d1fb41fe9fe5643385cbf7806b Parents: da0df82 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 13 18:02:16 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 13 22:16:36 2014 +0800 -- .../java/org/apache/camel/component/atom/UpdatedDateFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c0490006/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java -- diff --git a/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java b/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java index 8a78a1d..f5067a5 100644 --- a/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java +++ b/components/camel-atom/src/main/java/org/apache/camel/component/atom/UpdatedDateFilter.java @@ -50,7 +50,8 @@ public class UpdatedDateFilter implements EntryFilter { return true; } if (lastUpdate != null) { -if (lastUpdate.after(updated)) { +// we need to skip the latest updated entry +if (lastUpdate.after(updated) || lastUpdate.equals(updated)) { LOG.debug(Entry is older than lastupdate=[{}], no valid entry=[{}], lastUpdate, entry); return false; }
svn commit: r919246 [1/3] - in /websites/production/camel/content: ./ cache/
Author: buildbot Date: Wed Aug 13 14:18:28 2014 New Revision: 919246 Log: Production update by buildbot for camel Added: websites/production/camel/content/metrics-component.html Modified: websites/production/camel/content/book-architecture.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2140-release.html websites/production/camel/content/component-list-grouped.html websites/production/camel/content/component-list.html websites/production/camel/content/components.html websites/production/camel/content/transport.html websites/production/camel/content/uris.html Modified: websites/production/camel/content/book-architecture.html == --- websites/production/camel/content/book-architecture.html (original) +++ websites/production/camel/content/book-architecture.html Wed Aug 13 14:18:28 2014 @@ -378,7 +378,9 @@ disruptor-vm:someName[?lt;optiongt;] /div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Jakarta Commons Logging to log the message exchange to some underlying logging system like log4j/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=lucene.htmlLucene/a / camel-lucene/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[lucene:searcherName:lt;insert|querygt;[?options] ]]/script -/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina.htmlMINA/a / camel-mina/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=metrics-component.htmlMetrics/a / camel-metrics/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[Â metrics:[meter|counter|histogram|timer]:metricname[?options]]]/script +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpspan style=line-height: 1.4285715;Uses /spana shape=rect class=external-link href=http://metrics.codahale.com/; style=line-height: 1.4285715; rel=nofollowMetrics/aspan style=line-height: 1.4285715;#160;/spanspan style=line-height: 1.4285715; to collect application statistics directly from Camel routes./span/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina.htmlMINA/a / camel-mina/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[mina:[tcp|udp|vm]:host[:port][?options] ]]/script /div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpWorking with a shape=rect class=external-link href=http://mina.apache.org/;Apache MINA 1.x/a/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina2.htmlMINA2/a / camel-mina2/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Wed Aug 13 14:18:28 2014 @@ -762,7 +762,9 @@ disruptor-vm:someName[?lt;optiongt;] /div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Jakarta Commons Logging to log the message exchange to some underlying logging system like log4j/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=lucene.htmlLucene/a / camel-lucene/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[lucene:searcherName:lt;insert|querygt;[?options] ]]/script -/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina.htmlMINA/a / camel-mina/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1
svn commit: r919246 [2/3] - in /websites/production/camel/content: ./ cache/
Modified: websites/production/camel/content/component-list-grouped.html == --- websites/production/camel/content/component-list-grouped.html (original) +++ websites/production/camel/content/component-list-grouped.html Wed Aug 13 14:18:28 2014 @@ -84,967 +84,489 @@ tbody tr td valign=top width=100% -div class=wiki-content maincontenth2 id=ComponentListGrouped-AninformalgroupingofCamelcomponents.An informal grouping of Camel components./h2 - -pThis list was refined from the main components page in support of establishing information for the following poster:/p - -ulliThe Apache Camel Components Poster (a shape=rect class=external-link href=http://gliesian.com/camel/ApacheCamelComponents.pdf; rel=nofollowPDF/a, a shape=rect class=external-link href=http://gliesian.com/camel/ApacheCamelComponentsCropMarksAndBleed.pdf; rel=nofollowPDF w/ crops and bleed/a, a shape=rect class=external-link href=http://gliesian.com/camel/ApacheCamelComponents.jpg; rel=nofollowJPG image/a, a shape=rect class=external-link href=http://fineartamerica.com/featured/apache-camel-components-poster-gliesian-llc.html; rel=nofollowPrinted/a) emby Gliesian LLC./em (October, 2013)/li/ul - - -h3 id=ComponentListGrouped-AutomatingTasksAutomating Tasks/h3 - - -div class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThp Component / ArtifactId / URI /p/thth colspan=1 rowspan=1 class=confluenceThp Description /p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdp a shape=rect href=timer.htmlTimer/a / camel-core/p -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[ -timer:timerName[?lt;optionsgt;] -]]/script -/div/div /tdtd colspan=1 rowspan=1 class=confluenceTdp Used to generate message exchanges when a timer fires. Events can only be consumed from this endpoint. /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp a shape=rect href=quartz.htmlQuartz/a / camel-quartz/p -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[ -quartz://groupName/timerName[?lt;optionsgt;] -]]/script -/div/div /tdtd colspan=1 rowspan=1 class=confluenceTdp Provides a scheduled delivery of messages using the a shape=rect class=external-link href=http://www.quartz-scheduler.org/; rel=nofollowQuartz 1.x scheduler/a. /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp a shape=rect href=quartz2.htmlQuartz2/a / camel-quartz2/p -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[ -quartz2://groupName/timerName[?lt;optionsgt;] +div class=wiki-content maincontenth2 id=ComponentListGrouped-AninformalgroupingofCamelcomponents.An informal grouping of Camel components./h2pThis list was refined from the main components page in support of establishing information for the following poster:/pulliThe Apache Camel Components Poster (a shape=rect class=external-link href=http://gliesian.com/camel/ApacheCamelComponents.pdf; rel=nofollowPDF/a, a shape=rect class=external-link href=http://gliesian.com/camel/ApacheCamelComponentsCropMarksAndBleed.pdf; rel=nofollowPDF w/ crops and bleed/a, a shape=rect class=external-link href=http://gliesian.com/camel/ApacheCamelComponents.jpg; rel=nofollowJPG image/a, a shape=rect class=external-link href=http://fineartamerica.com/featured/apache-camel-components-poster-gliesian-llc.html; rel=nofollowPrinted/a) emby Gliesian LLC./em (October, 2013)/li/ulh3 id=ComponentListGrouped-AutomatingTasksAutomating Tasks/h3 div class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThpComponent / ArtifactId / URI/p/thth colspan=1 rowspan=1 class=confluenceThpDescription/p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=timer.htmlTimer/a / camel-core/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[timer:timerName[?lt;optionsgt;] ]]/script -/div/div /tdtd colspan=1 rowspan=1 class=confluenceTdp Provides a scheduled delivery of messages using the a shape=rect class=external-link href=http://www.quartz-scheduler.org/; rel=nofollowQuartz 2.x scheduler/a. /p/td/tr/tbody/table/div - - -h3 id=ComponentListGrouped-AmazonAmazon/h3 - -div class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThp Component / ArtifactId / URI /p/thth colspan=1 rowspan=1 class=confluenceThp Description /p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdp a shape=rect href=aws-cw.htmlAWS-CW/a / a shape=rect
svn commit: r919246 [3/3] - in /websites/production/camel/content: ./ cache/
Modified: websites/production/camel/content/component-list.html == --- websites/production/camel/content/component-list.html (original) +++ websites/production/camel/content/component-list.html Wed Aug 13 14:18:28 2014 @@ -338,7 +338,9 @@ disruptor-vm:someName[?lt;optiongt;] /div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Jakarta Commons Logging to log the message exchange to some underlying logging system like log4j/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=lucene.htmlLucene/a / camel-lucene/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[lucene:searcherName:lt;insert|querygt;[?options] ]]/script -/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina.htmlMINA/a / camel-mina/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=metrics-component.htmlMetrics/a / camel-metrics/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[Â metrics:[meter|counter|histogram|timer]:metricname[?options]]]/script +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpspan style=line-height: 1.4285715;Uses /spana shape=rect class=external-link href=http://metrics.codahale.com/; style=line-height: 1.4285715; rel=nofollowMetrics/aspan style=line-height: 1.4285715;#160;/spanspan style=line-height: 1.4285715; to collect application statistics directly from Camel routes./span/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina.htmlMINA/a / camel-mina/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[mina:[tcp|udp|vm]:host[:port][?options] ]]/script /div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpWorking with a shape=rect class=external-link href=http://mina.apache.org/;Apache MINA 1.x/a/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina2.htmlMINA2/a / camel-mina2/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl Modified: websites/production/camel/content/components.html == --- websites/production/camel/content/components.html (original) +++ websites/production/camel/content/components.html Wed Aug 13 14:18:28 2014 @@ -347,7 +347,9 @@ disruptor-vm:someName[?lt;optiongt;] /div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Jakarta Commons Logging to log the message exchange to some underlying logging system like log4j/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=lucene.htmlLucene/a / camel-lucene/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[lucene:searcherName:lt;insert|querygt;[?options] ]]/script -/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=mina.htmlMINA/a / camel-mina/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpUses Apache Lucene to perform Java-based indexing and full text based searches using advanced analysis/tokenization capabilities/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpa shape=rect href=metrics-component.htmlMetrics/a / camel-metrics/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: plain; gutter: false type=syntaxhighlighter![CDATA[Â metrics:[meter|counter|histogram|timer]:metricname[?options]]]/script +/div/div/tdtd colspan=1 rowspan=1 class=confluenceTdpspan style=line-height: 1.4285715;Uses /spana shape=rect class=external-link href=http://metrics.codahale.com/; style=line-height: 1.4285715; rel=nofollowMetrics/aspan style=line-height: 1.4285715;#160;/spanspan style=line-height: 1.4285715; to collect application statistics directly from Camel routes./span/p/td/trtrtd colspan=1
git commit: Update to get the setup.eclipse target working again
Repository: camel Updated Branches: refs/heads/master 25740b0e4 - c631bc624 Update to get the setup.eclipse target working again Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c631bc62 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c631bc62 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c631bc62 Branch: refs/heads/master Commit: c631bc6241a8e8a0757e69bc7ccdeda96565d90f Parents: 25740b0 Author: Daniel Kulp dk...@apache.org Authored: Wed Aug 13 11:19:24 2014 -0400 Committer: Daniel Kulp dk...@apache.org Committed: Wed Aug 13 11:27:14 2014 -0400 -- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c631bc62/pom.xml -- diff --git a/pom.xml b/pom.xml index f9c757c..78fe4fd 100755 --- a/pom.xml +++ b/pom.xml @@ -245,9 +245,10 @@ files for modules -- properties eclipse.workspace.dir${basedir}/../workspace/eclipse.workspace.dir +maven.test.skip.exectrue/maven.test.skip.exec /properties build -defaultGoalprocess-test-sources/defaultGoal +defaultGoalpackage/defaultGoal pluginManagement plugins plugin
[1/3] git commit: Add a profile to start working on full Jetty9 support
Repository: camel Updated Branches: refs/heads/master c631bc624 - e8e2a511a Add a profile to start working on full Jetty9 support Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/70334b83 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/70334b83 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/70334b83 Branch: refs/heads/master Commit: 70334b832b075cb11624197bfa28c5d2793cab71 Parents: c631bc6 Author: Daniel Kulp dk...@apache.org Authored: Wed Aug 13 11:36:19 2014 -0400 Committer: Daniel Kulp dk...@apache.org Committed: Wed Aug 13 11:36:19 2014 -0400 -- parent/pom.xml | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/70334b83/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 8f4f2e3..8066699 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -226,10 +226,11 @@ jdom-bundle-version1.1_4/jdom-bundle-version jdom-version1.1.3/jdom-version jedis-client-bundle-version2.1.0_1/jedis-client-bundle-version -jetty-version8.1.14.v20131031/jetty-version jetty6-bundle-version6.1.26_4/jetty6-bundle-version jetty6-version6.1.26/jetty6-version -jetty9-version9.2.1.v20140609/jetty9-version +jetty8-version8.1.15.v20140411/jetty8-version +jetty9-version9.2.2.v20140723/jetty9-version +jetty-version${jetty8-version}/jetty-version jettison-version1.3.5/jettison-version jexcelapi-bundle-version2.4.2_4/jexcelapi-bundle-version jexcelapi-version2.4.2/jexcelapi-version @@ -475,7 +476,7 @@ org.apache.commons.httpclient.*;version=[3.1,4.0), org.apache.velocity.*;version=[1.6.2,2), org.apache.xmlbeans.*;version=[2.4,3), - org.eclipse.jetty.*;version=[7.5,8.2), + org.eclipse.jetty.*;version=[7.5,10), com.thoughtworks.xstream.*;version=[1.3,2), org.antlr.stringtemplate.*;version=[3.0,4), org.jivesoftware.smack.*;version=[3.0,4), @@ -2863,6 +2864,13 @@ /profile profile +idjetty9/id +properties +jetty-version${jetty9-version}/jetty-version +/properties +/profile + +profile idjdk1.7/id activation jdk1.7/jdk
[3/3] git commit: Fix camel-linkedin-api to not reference stuff outside it's component so it can be pulled into eclipse
Fix camel-linkedin-api to not reference stuff outside it's component so it can be pulled into eclipse Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e8e2a511 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e8e2a511 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e8e2a511 Branch: refs/heads/master Commit: e8e2a511a18dde0d2102a9f87fe165c203890552 Parents: b144cff Author: Daniel Kulp dk...@apache.org Authored: Wed Aug 13 11:47:47 2014 -0400 Committer: Daniel Kulp dk...@apache.org Committed: Wed Aug 13 11:47:47 2014 -0400 -- .../camel-linkedin/camel-linkedin-api/pom.xml | 9 - .../src/test/resources/log4j.properties | 36 .../src/test/resources/test-options.properties | 28 +++ 3 files changed, 64 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e8e2a511/components/camel-linkedin/camel-linkedin-api/pom.xml -- diff --git a/components/camel-linkedin/camel-linkedin-api/pom.xml b/components/camel-linkedin/camel-linkedin-api/pom.xml index 9ef96ad..381b40c 100644 --- a/components/camel-linkedin/camel-linkedin-api/pom.xml +++ b/components/camel-linkedin/camel-linkedin-api/pom.xml @@ -105,15 +105,6 @@ /dependencies build -testResources - testResource -directory${project.basedir}/src/test/resources/directory - /testResource - testResource - directory${project.basedir}/../camel-linkedin-component/src/test/resources/directory - /testResource -/testResources - plugins !-- uncomment to validate XSD since wadl2java doesn't report line numbers in errors -- http://git-wip-us.apache.org/repos/asf/camel/blob/e8e2a511/components/camel-linkedin/camel-linkedin-api/src/test/resources/log4j.properties -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/test/resources/log4j.properties b/components/camel-linkedin/camel-linkedin-api/src/test/resources/log4j.properties new file mode 100644 index 000..fb1d365 --- /dev/null +++ b/components/camel-linkedin/camel-linkedin-api/src/test/resources/log4j.properties @@ -0,0 +1,36 @@ +# +# 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. +# + +# +# The logging properties used for testing. +# +log4j.rootLogger=INFO, file + +# uncomment the following line to turn on component debug messages +#log4j.logger.org.apache.camel.component.linkedin=DEBUG + +# CONSOLE appender not used by default +log4j.appender.out=org.apache.log4j.ConsoleAppender +log4j.appender.out.layout=org.apache.log4j.PatternLayout +#log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n +log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n + +# File appender +log4j.appender.file=org.apache.log4j.FileAppender +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n +log4j.appender.file.file=target/camel-linkedin-test.log http://git-wip-us.apache.org/repos/asf/camel/blob/e8e2a511/components/camel-linkedin/camel-linkedin-api/src/test/resources/test-options.properties -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/test/resources/test-options.properties b/components/camel-linkedin/camel-linkedin-api/src/test/resources/test-options.properties new file mode 100644 index 000..4bb03f0 --- /dev/null +++ b/components/camel-linkedin/camel-linkedin-api/src/test/resources/test-options.properties @@ -0,0 +1,28 @@ +# +# 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
[2/3] git commit: Fix a bunch of checkstyle issues in camel-linkedin
Fix a bunch of checkstyle issues in camel-linkedin Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b144cffb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b144cffb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b144cffb Branch: refs/heads/master Commit: b144cffb2bc2f24d8a1379f6898c7f38e3fda998 Parents: 70334b8 Author: Daniel Kulp dk...@apache.org Authored: Wed Aug 13 11:41:50 2014 -0400 Committer: Daniel Kulp dk...@apache.org Committed: Wed Aug 13 11:41:50 2014 -0400 -- .../component/linkedin/api/DoubleAdapter.java | 3 +- .../component/linkedin/api/LongAdapter.java | 3 +- .../api/AbstractResourceIntegrationTest.java| 4 +- .../internal/LinkedInPropertiesHelper.java | 2 +- .../linkedin/AbstractLinkedInTestSupport.java | 16 .../CommentsResourceIntegrationTest.java| 27 -- .../CompaniesResourceIntegrationTest.java | 53 .../linkedin/GroupsResourceIntegrationTest.java | 25 +- .../linkedin/JobsResourceIntegrationTest.java | 30 +-- .../linkedin/PeopleResourceIntegrationTest.java | 87 .../linkedin/PostsResourceIntegrationTest.java | 34 ++-- .../linkedin/SearchResourceIntegrationTest.java | 27 -- 12 files changed, 221 insertions(+), 90 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b144cffb/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/DoubleAdapter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/DoubleAdapter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/DoubleAdapter.java index 029681a..05a1a8e 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/DoubleAdapter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/DoubleAdapter.java @@ -18,8 +18,7 @@ package org.apache.camel.component.linkedin.api; import javax.xml.bind.annotation.adapters.XmlAdapter; -public class DoubleAdapter extends XmlAdapterString, Double -{ +public class DoubleAdapter extends XmlAdapterString, Double { public Double unmarshal(String value) { return javax.xml.bind.DatatypeConverter.parseDouble(value); http://git-wip-us.apache.org/repos/asf/camel/blob/b144cffb/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LongAdapter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LongAdapter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LongAdapter.java index 3fe63cc..9288108 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LongAdapter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LongAdapter.java @@ -18,8 +18,7 @@ package org.apache.camel.component.linkedin.api; import javax.xml.bind.annotation.adapters.XmlAdapter; -public class LongAdapter extends XmlAdapterString, Long -{ +public class LongAdapter extends XmlAdapterString, Long { public Long unmarshal(String value) { return new Long(value); http://git-wip-us.apache.org/repos/asf/camel/blob/b144cffb/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java index 1d4c536..d8f474e 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java +++ b/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java @@ -102,8 +102,8 @@ public class AbstractResourceIntegrationTest extends Assert { protected static T T getResource(ClassT resourceClass) { if (requestFilter == null) { -throw new IllegalStateException(AbstractResourceIntegrationTest.class.getName() + -.beforeClass must be invoked before getResource); +throw new
[2/2] git commit: Update to new scala plugin builders/natures
Update to new scala plugin builders/natures Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/343dd773 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/343dd773 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/343dd773 Branch: refs/heads/master Commit: 343dd7733b9b15199ddd2c3de26742df089964ef Parents: 8e7d44f Author: Daniel Kulp dk...@apache.org Authored: Wed Aug 13 12:15:37 2014 -0400 Committer: Daniel Kulp dk...@apache.org Committed: Wed Aug 13 12:15:37 2014 -0400 -- components/camel-swagger/pom.xml | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/343dd773/components/camel-swagger/pom.xml -- diff --git a/components/camel-swagger/pom.xml b/components/camel-swagger/pom.xml index e55c542..9997f98 100644 --- a/components/camel-swagger/pom.xml +++ b/components/camel-swagger/pom.xml @@ -44,7 +44,9 @@ artifactIdcamel-core/artifactId /dependency -!-- TODO: we should avoid spring dependency and have some plugin/spi -- +!-- + TODO: we should avoid spring dependency and have some plugin/spi + -- dependency groupIdorg.springframework/groupId artifactIdspring-web/artifactId @@ -140,14 +142,14 @@ artifactIdmaven-eclipse-plugin/artifactId configuration projectnatures -projectnaturech.epfl.lamp.sdt.core.scalanature/projectnature +projectnatureorg.scala-ide.sdt.core.scalanature/projectnature projectnatureorg.eclipse.jdt.core.javanature/projectnature /projectnatures buildcommands -buildcommandch.epfl.lamp.sdt.core.scalabuilder/buildcommand +buildcommandorg.scala-ide.sdt.core.scalabuilder/buildcommand /buildcommands classpathContainers - classpathContainerch.epfl.lamp.sdt.launching.SCALA_CONTAINER/classpathContainer + classpathContainerorg.scala-ide.sdt.launching.SCALA_CONTAINER/classpathContainer classpathContainerorg.eclipse.jdt.launching.JRE_CONTAINER/classpathContainer /classpathContainers /configuration
[1/2] git commit: Use jaxws21 frontend for code generation to make sure the generated code compiles fine for each of the variouis JDK versions
Repository: camel Updated Branches: refs/heads/master e8e2a511a - 343dd7733 Use jaxws21 frontend for code generation to make sure the generated code compiles fine for each of the variouis JDK versions Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8e7d44f9 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8e7d44f9 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8e7d44f9 Branch: refs/heads/master Commit: 8e7d44f9a3af06fad050518c49fd3ca1baaf9628 Parents: e8e2a51 Author: Daniel Kulp dk...@apache.org Authored: Wed Aug 13 11:53:39 2014 -0400 Committer: Daniel Kulp dk...@apache.org Committed: Wed Aug 13 11:56:37 2014 -0400 -- tests/camel-itest/pom.xml | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/8e7d44f9/tests/camel-itest/pom.xml -- diff --git a/tests/camel-itest/pom.xml b/tests/camel-itest/pom.xml index c492a56..8ef809b 100644 --- a/tests/camel-itest/pom.xml +++ b/tests/camel-itest/pom.xml @@ -390,10 +390,16 @@ testSourceRoot${basedir}/target/generated/src/test/java/testSourceRoot wsdlOptions wsdlOption + frontEndjaxws21/frontEnd wsdl${basedir}/src/test/resources/wsdl/CustomerService-1.0.0.wsdl/wsdl /wsdlOption wsdlOption +frontEndjaxws21/frontEnd + wsdl${basedir}/src/test/resources/wsdl/CustomerService_noSoapAction.wsdl/wsdl +/wsdlOption +wsdlOption wsdl${basedir}/src/test/resources/wsdl/hello_world.wsdl/wsdl + frontEndjaxws21/frontEnd bindingFiles bindingFile${basedir}/src/test/resources/wsdl/binding.xml/bindingFile /bindingFiles
[CONF] Apache Camel HTTP4
willem jiang edited the page: HTTP4 ... Name Default Value Description maxTotalConnections 200 The maximum number of connections. connectionsPerRoute 20 The maximum number of connections per route. cookieStore null Camel 2.11.2/2.12.0: To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookies shouldn't be stored as we are just bridging (eg acting as a proxy). httpClientConfigurer null Reference to a org.apache.camel.component.http.HttpClientConfigurer in the Registry. clientConnectionManager null To use a custom org.apache.http.conn.ClientConnectionManager. httpBinding null To use a custom org.apache.camel.component.http.HttpBinding. httpContext null Camel 2.9.2: To use a custom org.apache.http.protocol.HttpContext when executing requests.
git commit: Fix for CAMEL-7694 Eliminated race condition which caused intermittent test failures
Repository: camel Updated Branches: refs/heads/master 343dd7733 - b2c3b31bb Fix for CAMEL-7694 Eliminated race condition which caused intermittent test failures Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b2c3b31b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b2c3b31b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b2c3b31b Branch: refs/heads/master Commit: b2c3b31bba3191aa193cbb672b5d353fd2818ed2 Parents: 343dd77 Author: Kevin Earls ke...@kevinearls.com Authored: Wed Aug 13 19:42:00 2014 +0200 Committer: Kevin Earls ke...@kevinearls.com Committed: Wed Aug 13 19:42:34 2014 +0200 -- .../restlet/example/RestletGroovyIssueTest.java | 23 ++-- 1 file changed, 16 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b2c3b31b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java -- diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java index 2803ac9..68f68f4 100644 --- a/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java +++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java @@ -16,39 +16,48 @@ */ package org.apache.camel.itest.restlet.example; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @version */ public class RestletGroovyIssueTest extends CamelTestSupport { - +protected static final Logger LOG = LoggerFactory.getLogger(RestletGroovyIssueTest.class); private long port = AvailablePortFinder.getNextAvailable(16000); private ExecutorService executorService = Executors.newFixedThreadPool(5); @Test public void testRestletGroovy() throws Exception { -getMockEndpoint(mock:input).expectedMessageCount(10); -getMockEndpoint(mock:output).expectedBodiesReceivedInAnyOrder(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); - -for (int i = 0; i 10; i++) { -final Integer num = i; +String[] bodies = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +ListString expectedBodies = Arrays.asList(bodies); +final CountDownLatch responsesToReceive = new CountDownLatch(expectedBodies.size()); + getMockEndpoint(mock:input).expectedMessageCount(expectedBodies.size()); + getMockEndpoint(mock:output).expectedBodiesReceivedInAnyOrder(expectedBodies); + +for (final String s : expectedBodies) { executorService.submit(new Runnable() { @Override public void run() { -String s = + num; Object response = template.requestBody(restlet:http://localhost:; + port + /foo/ + s + ?restletMethod=GET, ); assertEquals(s, response); +responsesToReceive.countDown(); }; }); } +responsesToReceive.await(5, TimeUnit.SECONDS); assertMockEndpointsSatisfied(); executorService.shutdownNow();
[2/2] git commit: Fix for CAMEL-7694 Eliminated race condition which caused intermittent test failures
Fix for CAMEL-7694 Eliminated race condition which caused intermittent test failures Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c8c74742 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c8c74742 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c8c74742 Branch: refs/heads/camel-2.12.x Commit: c8c7474291fa6265f804c37ed21e20ca64d19198 Parents: c049000 Author: Kevin Earls ke...@kevinearls.com Authored: Wed Aug 13 19:42:00 2014 +0200 Committer: Willem Jiang willem.ji...@gmail.com Committed: Thu Aug 14 10:14:57 2014 +0800 -- .../restlet/example/RestletGroovyIssueTest.java | 23 ++-- 1 file changed, 16 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c8c74742/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java -- diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java index 2803ac9..68f68f4 100644 --- a/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java +++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java @@ -16,39 +16,48 @@ */ package org.apache.camel.itest.restlet.example; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @version */ public class RestletGroovyIssueTest extends CamelTestSupport { - +protected static final Logger LOG = LoggerFactory.getLogger(RestletGroovyIssueTest.class); private long port = AvailablePortFinder.getNextAvailable(16000); private ExecutorService executorService = Executors.newFixedThreadPool(5); @Test public void testRestletGroovy() throws Exception { -getMockEndpoint(mock:input).expectedMessageCount(10); -getMockEndpoint(mock:output).expectedBodiesReceivedInAnyOrder(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); - -for (int i = 0; i 10; i++) { -final Integer num = i; +String[] bodies = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +ListString expectedBodies = Arrays.asList(bodies); +final CountDownLatch responsesToReceive = new CountDownLatch(expectedBodies.size()); + getMockEndpoint(mock:input).expectedMessageCount(expectedBodies.size()); + getMockEndpoint(mock:output).expectedBodiesReceivedInAnyOrder(expectedBodies); + +for (final String s : expectedBodies) { executorService.submit(new Runnable() { @Override public void run() { -String s = + num; Object response = template.requestBody(restlet:http://localhost:; + port + /foo/ + s + ?restletMethod=GET, ); assertEquals(s, response); +responsesToReceive.countDown(); }; }); } +responsesToReceive.await(5, TimeUnit.SECONDS); assertMockEndpointsSatisfied(); executorService.shutdownNow();
[1/2] git commit: Fix for CAMEL-7694 Eliminated race condition which caused intermittent test failures
Repository: camel Updated Branches: refs/heads/camel-2.12.x c0490006f - c8c747429 refs/heads/camel-2.13.x a174e0d6e - 7779ceeca Fix for CAMEL-7694 Eliminated race condition which caused intermittent test failures Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7779ceec Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7779ceec Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7779ceec Branch: refs/heads/camel-2.13.x Commit: 7779ceecae2ee2a4848c43bca7ead4e23421acf2 Parents: a174e0d Author: Kevin Earls ke...@kevinearls.com Authored: Wed Aug 13 19:42:00 2014 +0200 Committer: Willem Jiang willem.ji...@gmail.com Committed: Thu Aug 14 10:14:46 2014 +0800 -- .../restlet/example/RestletGroovyIssueTest.java | 23 ++-- 1 file changed, 16 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7779ceec/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java -- diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java index 2803ac9..68f68f4 100644 --- a/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java +++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/restlet/example/RestletGroovyIssueTest.java @@ -16,39 +16,48 @@ */ package org.apache.camel.itest.restlet.example; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @version */ public class RestletGroovyIssueTest extends CamelTestSupport { - +protected static final Logger LOG = LoggerFactory.getLogger(RestletGroovyIssueTest.class); private long port = AvailablePortFinder.getNextAvailable(16000); private ExecutorService executorService = Executors.newFixedThreadPool(5); @Test public void testRestletGroovy() throws Exception { -getMockEndpoint(mock:input).expectedMessageCount(10); -getMockEndpoint(mock:output).expectedBodiesReceivedInAnyOrder(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); - -for (int i = 0; i 10; i++) { -final Integer num = i; +String[] bodies = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +ListString expectedBodies = Arrays.asList(bodies); +final CountDownLatch responsesToReceive = new CountDownLatch(expectedBodies.size()); + getMockEndpoint(mock:input).expectedMessageCount(expectedBodies.size()); + getMockEndpoint(mock:output).expectedBodiesReceivedInAnyOrder(expectedBodies); + +for (final String s : expectedBodies) { executorService.submit(new Runnable() { @Override public void run() { -String s = + num; Object response = template.requestBody(restlet:http://localhost:; + port + /foo/ + s + ?restletMethod=GET, ); assertEquals(s, response); +responsesToReceive.countDown(); }; }); } +responsesToReceive.await(5, TimeUnit.SECONDS); assertMockEndpointsSatisfied(); executorService.shutdownNow();
svn commit: r919290 - in /websites/production/camel/content: cache/main.pageCache http4.html
Author: buildbot Date: Thu Aug 14 02:17:49 2014 New Revision: 919290 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/http4.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/http4.html == --- websites/production/camel/content/http4.html (original) +++ websites/production/camel/content/http4.html Thu Aug 14 02:17:49 2014 @@ -110,7 +110,7 @@ pYou can only produce to endpoints generated by the HTTP4 component. Therefore it should never be used as input into your Camel Routes. To bind/expose an HTTP endpoint via a HTTP server as input to a Camel route, use the a shape=rect href=jetty.htmlJetty Component/a instead./p /div /div -h3 id=HTTP4-HttpComponentOptionsHttpComponent Options/h3div class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThpName/p/thth colspan=1 rowspan=1 class=confluenceThpDefault Value/p/thth colspan=1 rowspan=1 class=confluenceThpDescription/p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodemaxTotalConnections/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode200/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe maximum number of connections./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeconnectionsPerRoute/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode20/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe maximum number of connections per route./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodecookieStore/code/p/tdtd col span=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.11.2/2.12.0:/strong To use a custom codeorg.apache.http.client.CookieStore/code. By default the codeorg.apache.http.impl.client.BasicCookieStore/code is used which is an in-memory only cookie store. Notice if codebridgeEndpoint=true/code then the cookie store is forced to be a noop cookie store as cookies shouldn't be stored as we are just bridging (eg acting as a proxy)./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodehttpClientConfigurer/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpReference to a codeorg.apache.camel.component.http.HttpClientConfigurer/code in the a shape=rect href=registry.htmlRegistry/a./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeclientConnecti onManager/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpTo use a custom codeorg.apache.http.conn.ClientConnectionManager/code./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodehttpBinding/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpTo use a custom codeorg.apache.camel.component.http.HttpBinding/code./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodehttpContext/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.9.2:/strong To use a custom codeorg.apache.http.protocol.HttpContext/code when executing requests./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodesslContextParameters/code/p/ tdtd colspan=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.8:/strong To use a custom codeorg.apache.camel.util.jsse.SSLContextParameters/code. See a shape=rect href=#HTTP4-UsingtheJSSEConfigurationUtilityUsing the JSSE Configuration Utility/a. strongImportant:/strong Only one instance of codeorg.apache.camel.util.jsse.SSLContextParameters/code is supported per HttpComponent. If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need. See further below for more details./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodex509HostnameVerifier/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodeBrowserCompatHostnameVerifier/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.7:/strong You can refer to a different codeorg.apache.http.conn.ssl.X509H ostnameVerifier/code instance in the a shape=rect href=registry.htmlRegistry/a such as codeorg.apache.http.conn.ssl.StrictHostnameVerifier/code or codeorg.apache.http.conn.ssl.AllowAllHostnameVerifier/code./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeconnectionTimeToLive/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode-1/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.11.0:/strong The time for connection to live, the time unit is millisecond, the default value is