camel git commit: Fixed CS
Repository: camel Updated Branches: refs/heads/camel-2.17.x cf939a692 -> 2450bcad5 Fixed CS Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2450bcad Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2450bcad Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2450bcad Branch: refs/heads/camel-2.17.x Commit: 2450bcad58d44b1e083447a1e8eb4c2248aa6cc0 Parents: cf939a6 Author: Claus IbsenAuthored: Sun Jun 12 17:27:38 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 17:27:38 2016 +0200 -- .../org/apache/camel/component/dozer/DozerEndpoint.java | 5 +++-- .../elasticsearch/ElasticsearchConfiguration.java | 12 ++-- .../java/org/apache/camel/karaf/commands/RestShow.java | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2450bcad/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java -- diff --git a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java index 190d1cc..92774b7 100644 --- a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java +++ b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java @@ -167,10 +167,11 @@ public class DozerEndpoint extends DefaultEndpoint { BeanContainer.getInstance().setElementReader(reader); } finally { Thread.currentThread().setContextClassLoader(tccl); -if (elprop != null) +if (elprop != null) { System.setProperty("javax.el.ExpressionFactory", elprop); -else +} else { System.clearProperty("javax.el.ExpressionFactory"); +} } } http://git-wip-us.apache.org/repos/asf/camel/blob/2450bcad/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 6aef4f8..c3bd9e5 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 @@ -184,11 +184,11 @@ public class ElasticsearchConfiguration { /** * The path.home property of ElasticSearch configuration. You need to provide a valid path, otherwise the default, /usr/share/elasticsearch, will be used. */ - public String getPathHome() { - return pathHome; - } +public String getPathHome() { +return pathHome; +} - public void setPathHome(String pathHome) { - this.pathHome = pathHome; - } +public void setPathHome(String pathHome) { +this.pathHome = pathHome; +} } http://git-wip-us.apache.org/repos/asf/camel/blob/2450bcad/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RestShow.java -- diff --git a/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RestShow.java b/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RestShow.java index eea0911..55422c4 100644 --- a/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RestShow.java +++ b/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RestShow.java @@ -25,7 +25,7 @@ public class RestShow extends CamelCommandSupport { @Argument(index = 0, name = "name", description = "The name of the Camel context", required = true, multiValued = false) String name; - + public Object doExecute() throws Exception { RestShowCommand command = new RestShowCommand(name); return command.execute(camelController, System.out, System.err);
[1/4] camel git commit: CAMEL-10051 - Fixed issue with reuse channel.
Repository: camel Updated Branches: refs/heads/camel-2.17.x df2a31a4b -> cf939a692 refs/heads/master 7c4dd0b4f -> 3c11ff553 CAMEL-10051 - Fixed issue with reuse channel. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/96d3ce29 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/96d3ce29 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/96d3ce29 Branch: refs/heads/master Commit: 96d3ce29aadfe801b604b5db1db3581e64eb5ebd Parents: 7c4dd0b Author: grigoriadisAuthored: Sun Jun 12 15:48:41 2016 +0300 Committer: Claus Ibsen Committed: Sun Jun 12 16:26:51 2016 +0200 -- .../org/apache/camel/component/netty4/NettyProducer.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/96d3ce29/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java -- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java index a6bce2d..81e6cb2 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java @@ -282,7 +282,13 @@ public class NettyProducer extends DefaultAsyncProducer { // need to declare as final final Channel channel = existing; -final AsyncCallback producerCallback = new NettyProducerCallback(channel, callback); +final AsyncCallback producerCallback; + +if(configuration.isReuseChannel()) { +producerCallback = callback; +} else { +producerCallback = new NettyProducerCallback(channel, callback); +} // setup state as attachment on the channel, so we can access the state later when needed putState(channel, new NettyCamelState(producerCallback, exchange));
[2/4] camel git commit: Fixed CS. This closes #1026
Fixed CS. This closes #1026 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3c11ff55 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3c11ff55 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3c11ff55 Branch: refs/heads/master Commit: 3c11ff553fad9329bd4bf5df577b61d45a8c9cc4 Parents: 96d3ce2 Author: Claus IbsenAuthored: Sun Jun 12 16:30:24 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 16:30:24 2016 +0200 -- .../java/org/apache/camel/component/netty4/NettyProducer.java| 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3c11ff55/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java -- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java index 81e6cb2..e04452e 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java @@ -284,7 +284,9 @@ public class NettyProducer extends DefaultAsyncProducer { final Channel channel = existing; final AsyncCallback producerCallback; -if(configuration.isReuseChannel()) { +if (configuration.isReuseChannel()) { +// use callback as-is because we should not put it back in the pool as NettyProducerCallback would do +// as when reuse channel is enabled it will put the channel back in the pool when exchange is done using on completion producerCallback = callback; } else { producerCallback = new NettyProducerCallback(channel, callback);
[4/4] camel git commit: Fixed CS. This closes #1026
Fixed CS. This closes #1026 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cf939a69 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cf939a69 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cf939a69 Branch: refs/heads/camel-2.17.x Commit: cf939a6927dd28882046a03fb32c5b45e5ff2054 Parents: eed88d1 Author: Claus IbsenAuthored: Sun Jun 12 16:30:24 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 16:32:02 2016 +0200 -- .../java/org/apache/camel/component/netty4/NettyProducer.java| 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/cf939a69/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java -- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java index 4bdc121..a1b8d7f 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java @@ -280,7 +280,9 @@ public class NettyProducer extends DefaultAsyncProducer { final Channel channel = existing; final AsyncCallback producerCallback; -if(configuration.isReuseChannel()) { +if (configuration.isReuseChannel()) { +// use callback as-is because we should not put it back in the pool as NettyProducerCallback would do +// as when reuse channel is enabled it will put the channel back in the pool when exchange is done using on completion producerCallback = callback; } else { producerCallback = new NettyProducerCallback(channel, callback);
[3/4] camel git commit: CAMEL-10051 - Fixed issue with reuse channel.
CAMEL-10051 - Fixed issue with reuse channel. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eed88d16 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eed88d16 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eed88d16 Branch: refs/heads/camel-2.17.x Commit: eed88d16f57f351a54c4832c68ecb9d1ece21428 Parents: df2a31a Author: grigoriadisAuthored: Sun Jun 12 15:48:41 2016 +0300 Committer: Claus Ibsen Committed: Sun Jun 12 16:31:54 2016 +0200 -- .../org/apache/camel/component/netty4/NettyProducer.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/eed88d16/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java -- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java index c181ebf..4bdc121 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java @@ -278,7 +278,13 @@ public class NettyProducer extends DefaultAsyncProducer { // need to declare as final final Channel channel = existing; -final AsyncCallback producerCallback = new NettyProducerCallback(channel, callback); +final AsyncCallback producerCallback; + +if(configuration.isReuseChannel()) { +producerCallback = callback; +} else { +producerCallback = new NettyProducerCallback(channel, callback); +} // setup state as attachment on the channel, so we can access the state later when needed putState(channel, new NettyCamelState(producerCallback, exchange));
[3/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d1f6175 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d1f6175 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d1f6175 Branch: refs/heads/camel-2.16.x Commit: 7d1f61759674c8f0d139f4b5e51fe0ab58bdfae6 Parents: f17b51d Author: Claus IbsenAuthored: Sun Jun 12 14:22:54 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 14:23:07 2016 +0200 -- .../apache/camel/util/AsyncProcessorConverterHelper.java | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7d1f6175/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java index 6b1862e..14319ed 100644 --- a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java +++ b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java @@ -123,13 +123,21 @@ public final class AsyncProcessorConverterHelper { return false; } +if (processor == null) { +return false; +} + ProcessorToAsyncProcessorBridge that = (ProcessorToAsyncProcessorBridge) o; return processor.equals(that.processor); } @Override public int hashCode() { -return processor.hashCode(); +if (processor != null) { +return processor.hashCode(); +} else { +return 0; +} } }
[1/3] camel git commit: CAMEL-10050: Routing slip no longer caches error handlers.
Repository: camel Updated Branches: refs/heads/camel-2.16.x f17b51d18 -> 7d1f61759 refs/heads/camel-2.17.x 900cf6947 -> df2a31a4b refs/heads/master ddb852cdf -> 7c4dd0b4f CAMEL-10050: Routing slip no longer caches error handlers. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7c4dd0b4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7c4dd0b4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7c4dd0b4 Branch: refs/heads/master Commit: 7c4dd0b4f6ecd4840e4ccdbf1d7c28f2e8cb5691 Parents: ddb852c Author: Claus IbsenAuthored: Sun Jun 12 14:21:46 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 14:21:46 2016 +0200 -- .../camel/processor/DefaultErrorHandler.java| 4 ++ .../org/apache/camel/processor/RoutingSlip.java | 65 +--- .../util/AsyncProcessorConverterHelper.java | 10 ++- .../camel/issues/RoutingSlipMemoryLeakTest.java | 15 + 4 files changed, 44 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7c4dd0b4/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java b/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java index 7f94887..f6dc784 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java +++ b/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java @@ -69,4 +69,8 @@ public class DefaultErrorHandler extends RedeliveryErrorHandler { return "DefaultErrorHandler[" + output + "]"; } +public Processor getDeadLetterProcessor() { +return deadLetter; +} + } http://git-wip-us.apache.org/repos/asf/camel/blob/7c4dd0b4/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java index d2d46af..c081d46 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java +++ b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java @@ -17,8 +17,6 @@ package org.apache.camel.processor; import java.util.Iterator; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import org.apache.camel.AsyncCallback; import org.apache.camel.AsyncProcessor; @@ -44,7 +42,6 @@ import org.apache.camel.spi.RouteContext; import org.apache.camel.support.ServiceSupport; import org.apache.camel.util.AsyncProcessorHelper; import org.apache.camel.util.ExchangeHelper; -import org.apache.camel.util.KeyValueHolder; import org.apache.camel.util.MessageHelper; import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.ServiceHelper; @@ -73,20 +70,6 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace protected Expression expression; protected String uriDelimiter; protected final CamelContext camelContext; -private final ConcurrentMap errorHandlers = new ConcurrentHashMap (); - -/** - * Class that represents prepared fine grained error handlers when processing routingslip/dynamic-router exchanges - * - * This is similar to how multicast processor does. - */ -static final class PreparedErrorHandler extends KeyValueHolder { - -PreparedErrorHandler(String key, Processor value) { -super(key, value); -} - -} /** * The iterator to be used for retrieving the next routing slip(s) to be used. @@ -336,16 +319,6 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // this is needed to support redelivery on that output alone and not doing redelivery // for the entire routingslip/dynamic-router block again which will start from scratch again -// create key for cache -final PreparedErrorHandler key = new PreparedErrorHandler(endpoint.getEndpointUri(), processor); - -// lookup cached first to reuse and preserve memory -answer = errorHandlers.get(key); -if (answer != null) { -log.trace("Using existing error handler for: {}", processor); -return answer; -} - log.trace("Creating error handler for: {}", processor); ErrorHandlerFactory builder = routeContext.getRoute().getErrorHandlerBuilder();
[2/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/df2a31a4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/df2a31a4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/df2a31a4 Branch: refs/heads/camel-2.17.x Commit: df2a31a4b1f45efd989bbf23bad581039e34d815 Parents: 900cf69 Author: Claus IbsenAuthored: Sun Jun 12 14:22:54 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 14:22:54 2016 +0200 -- .../apache/camel/util/AsyncProcessorConverterHelper.java | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/df2a31a4/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java index 6b1862e..14319ed 100644 --- a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java +++ b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java @@ -123,13 +123,21 @@ public final class AsyncProcessorConverterHelper { return false; } +if (processor == null) { +return false; +} + ProcessorToAsyncProcessorBridge that = (ProcessorToAsyncProcessorBridge) o; return processor.equals(that.processor); } @Override public int hashCode() { -return processor.hashCode(); +if (processor != null) { +return processor.hashCode(); +} else { +return 0; +} } }
[2/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/900cf694 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/900cf694 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/900cf694 Branch: refs/heads/camel-2.17.x Commit: 900cf6947a2142fb7d0b4fa31931da0704744228 Parents: be70180 Author: Claus IbsenAuthored: Sun Jun 12 11:39:46 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 11:40:40 2016 +0200 -- .../main/java/org/apache/camel/processor/RoutingSlip.java | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/900cf694/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java index 641834c..d2d46af 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java +++ b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java @@ -80,9 +80,9 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace * * This is similar to how multicast processor does. */ -static final class PreparedErrorHandler extends KeyValueHolder { +static final class PreparedErrorHandler extends KeyValueHolder { -PreparedErrorHandler(RouteContext key, Processor value) { +PreparedErrorHandler(String key, Processor value) { super(key, value); } @@ -324,7 +324,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace return copy; } -protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor) { +protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor, Endpoint endpoint) { AsyncProcessor answer = processor; boolean tryBlock = exchange.getProperty(Exchange.TRY_ROUTE_BLOCK, false, boolean.class); @@ -337,7 +337,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // for the entire routingslip/dynamic-router block again which will start from scratch again // create key for cache -final PreparedErrorHandler key = new PreparedErrorHandler(routeContext, processor); +final PreparedErrorHandler key = new PreparedErrorHandler(endpoint.getEndpointUri(), processor); // lookup cached first to reuse and preserve memory answer = errorHandlers.get(key); @@ -379,7 +379,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // rework error handling to support fine grained error handling RouteContext routeContext = exchange.getUnitOfWork() != null ? exchange.getUnitOfWork().getRouteContext() : null; -asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer); +asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer, endpoint); // set property which endpoint we send to exchange.setProperty(Exchange.TO_ENDPOINT, endpoint.getEndpointUri());
[3/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f17b51d1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f17b51d1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f17b51d1 Branch: refs/heads/camel-2.16.x Commit: f17b51d18b990e0ef6de56c7d59392b7e3d8f280 Parents: c7ef72a Author: Claus IbsenAuthored: Sun Jun 12 11:39:46 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 11:42:03 2016 +0200 -- .../java/org/apache/camel/processor/RoutingSlip.java | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/f17b51d1/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java index c684593..d2d46af 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java +++ b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java @@ -41,7 +41,6 @@ import org.apache.camel.impl.ProducerCache; import org.apache.camel.spi.EndpointUtilizationStatistics; import org.apache.camel.spi.IdAware; import org.apache.camel.spi.RouteContext; -import org.apache.camel.spi.UnitOfWork; import org.apache.camel.support.ServiceSupport; import org.apache.camel.util.AsyncProcessorHelper; import org.apache.camel.util.ExchangeHelper; @@ -81,9 +80,9 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace * * This is similar to how multicast processor does. */ -static final class PreparedErrorHandler extends KeyValueHolder { +static final class PreparedErrorHandler extends KeyValueHolder { -public PreparedErrorHandler(RouteContext key, Processor value) { +PreparedErrorHandler(String key, Processor value) { super(key, value); } @@ -325,7 +324,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace return copy; } -protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor) { +protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor, Endpoint endpoint) { AsyncProcessor answer = processor; boolean tryBlock = exchange.getProperty(Exchange.TRY_ROUTE_BLOCK, false, boolean.class); @@ -338,7 +337,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // for the entire routingslip/dynamic-router block again which will start from scratch again // create key for cache -final PreparedErrorHandler key = new PreparedErrorHandler(routeContext, processor); +final PreparedErrorHandler key = new PreparedErrorHandler(endpoint.getEndpointUri(), processor); // lookup cached first to reuse and preserve memory answer = errorHandlers.get(key); @@ -380,7 +379,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // rework error handling to support fine grained error handling RouteContext routeContext = exchange.getUnitOfWork() != null ? exchange.getUnitOfWork().getRouteContext() : null; -asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer); +asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer, endpoint); // set property which endpoint we send to exchange.setProperty(Exchange.TO_ENDPOINT, endpoint.getEndpointUri());
[1/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
Repository: camel Updated Branches: refs/heads/camel-2.16.x c7ef72a56 -> f17b51d18 refs/heads/camel-2.17.x be70180be -> 900cf6947 refs/heads/master e3890695b -> ddb852cdf CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ddb852cd Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ddb852cd Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ddb852cd Branch: refs/heads/master Commit: ddb852cdf7da29827fcab0b25a2b2ed6ee443cf9 Parents: e389069 Author: Claus IbsenAuthored: Sun Jun 12 11:39:46 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 11:39:46 2016 +0200 -- .../main/java/org/apache/camel/processor/RoutingSlip.java | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ddb852cd/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java index 641834c..d2d46af 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java +++ b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java @@ -80,9 +80,9 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace * * This is similar to how multicast processor does. */ -static final class PreparedErrorHandler extends KeyValueHolder { +static final class PreparedErrorHandler extends KeyValueHolder { -PreparedErrorHandler(RouteContext key, Processor value) { +PreparedErrorHandler(String key, Processor value) { super(key, value); } @@ -324,7 +324,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace return copy; } -protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor) { +protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor, Endpoint endpoint) { AsyncProcessor answer = processor; boolean tryBlock = exchange.getProperty(Exchange.TRY_ROUTE_BLOCK, false, boolean.class); @@ -337,7 +337,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // for the entire routingslip/dynamic-router block again which will start from scratch again // create key for cache -final PreparedErrorHandler key = new PreparedErrorHandler(routeContext, processor); +final PreparedErrorHandler key = new PreparedErrorHandler(endpoint.getEndpointUri(), processor); // lookup cached first to reuse and preserve memory answer = errorHandlers.get(key); @@ -379,7 +379,7 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace // rework error handling to support fine grained error handling RouteContext routeContext = exchange.getUnitOfWork() != null ? exchange.getUnitOfWork().getRouteContext() : null; -asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer); +asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer, endpoint); // set property which endpoint we send to exchange.setProperty(Exchange.TO_ENDPOINT, endpoint.getEndpointUri());
svn commit: r990436 - in /websites/production/camel/content: cache/main.pageCache camel-2180-release.html
Author: buildbot Date: Sun Jun 12 09:19:00 2016 New Revision: 990436 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2180-release.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-2180-release.html == --- websites/production/camel/content/camel-2180-release.html (original) +++ websites/production/camel/content/camel-2180-release.html Sun Jun 12 09:19:00 2016 @@ -85,7 +85,7 @@ -Camel 2.18.0 release (currently in progress)http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; data-image-src="http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;>New and NoteworthyWelcome to the 2.18.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)All CamelComponents that has options to be configured now supports and includeSpring Bootauto configuration for those options, so they can easily be configured in your application.yaml file when using Spring Boot with Camel.Added Hystrix EIP as EIP pattern that uses native Netflixx Hystrix as the Circuit Breaker implementation.This requires havingcamel-hsytrixon the classpath.AddedService Call EIP as EIP pattern that allows to call a remote service in a distributed system, where the service is looked up from a service registry of some sorts, such as kubernetes, consul, etcd, zookeeper etc.Running Camel withSpring Boot now includes a Camel Health Indicator (actuator) if spring-boot-starter-actuatoris on the classpath.Spring-DM for OSGi moved out of camel-spring into a separate camel-spring-dm module.Improved theBean component to better match method parameter types when usingSimple language as parameter values.AddedBindyConverter that allows to implement custom data converters forBindyThe access in theRest DSL has been deprecated and no longer in use - its not part of swagger specification anymore.Camel-NATSnow uses JNATS client instead of the deprecated Java_nats one.During startup ofCamelContext the services that are used as part of routes are now deferred being started to the end of the startup process. Some IoC frameworks like Spring can otherwise causes a circular dependency issue if services are started too early. A side effect is that if service startup failures happen when being started later, they are now wrapped in the FailedToStartupRouteException to better pin point which route thas the problem.Improved the startup sequence ofSpring Java Config to be similar toSpring Boot that helps prevent Spring initialization errors about circular dependencies issues.Added PATCH toRest DSLAdded "starts with" and "ends with" operator to the Simplelanguage.AddedBeanIOSplitter toBeanIO that can be used with theSplitter EIP to split big payloa ds in streaming mode without reading the entire content into memory.Some of the AWScomponents allows to specify ARN in the endpoint configuration.The create operation inZookeeper now creates sub paths if missing.Added support for async mode forSERVLET component to leverage Asynchronous Servlet from the Servlet 3.0 spec.Beancomponent and Bean Languagevalidates method name must be a valid according to java identifier rules, and also if parameter syntax has an ending parenthesis.You can now use@RunWith(CamelSpringBootJUnit4ClassRunner.class) to test CamelSpring Bootapplications and use the Camel test annotations fromSpring Testing such as@MockEndpoints.To turn on logging exhausted message body with the message history you can configure this easily on the CamelContext level withsetLogExhaustedMessageBodyCamel-Infinispan now supports Aggregation Repository: InfinispanLocalAggregationRepository and InfinispanRemoteAggregationRepositoryTheSQL Componentand ElSqlnow supports outputType=StreamListto use an iterator for the output of the SQL query that allows to process the data in a streaming fashion such as with theSplitter EIP to process the data row by row, and load data from the database as needed.JPA now includes aJpaPollingConsumer implementation that better supportsContent Enricher usingpollEnrich to do a on-demand poll that returns either none, one or a list of entities as the result.CallingBeanwith method parameters defined usingSimple parameters, now avoids an intermediate conversion of the parameters to a String value. This ensures the passed in values when calling the bean method is using the parameter type as-is fromSimple.Camel CDI now supports importing Camel XML configuration filesCamel CDIdoes not deploy an empty Camel context bean anymore if not route builder beans nor Camel beans are deployedCamel CDIadds
[3/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c7ef72a5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c7ef72a5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c7ef72a5 Branch: refs/heads/camel-2.16.x Commit: c7ef72a562fd2d89a792b47d14ae43734a37994e Parents: 63f851c Author: Claus IbsenAuthored: Sun Jun 12 11:08:03 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 11:10:57 2016 +0200 -- .../util/AsyncProcessorConverterHelper.java | 20 - .../camel/issues/RoutingSlipMemoryLeakTest.java | 80 2 files changed, 99 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c7ef72a5/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java index a48e037..6b1862e 100644 --- a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java +++ b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java @@ -45,7 +45,7 @@ public final class AsyncProcessorConverterHelper { * It is important that this implements {@link DelegateProcessor} */ private static final class ProcessorToAsyncProcessorBridge implements DelegateProcessor, AsyncProcessor, Navigate, Service { -protected Processor processor; +protected final Processor processor; private ProcessorToAsyncProcessorBridge(Processor processor) { this.processor = processor; @@ -113,6 +113,24 @@ public final class AsyncProcessorConverterHelper { public Processor getProcessor() { return processor; } + +@Override +public boolean equals(Object o) { +if (this == o) { +return true; +} +if (o == null || getClass() != o.getClass()) { +return false; +} + +ProcessorToAsyncProcessorBridge that = (ProcessorToAsyncProcessorBridge) o; +return processor.equals(that.processor); +} + +@Override +public int hashCode() { +return processor.hashCode(); +} } public static AsyncProcessor convert(Processor value) { http://git-wip-us.apache.org/repos/asf/camel/blob/c7ef72a5/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java b/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java new file mode 100644 index 000..7ead2b3 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java @@ -0,0 +1,80 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.issues; + +import java.lang.reflect.Field; +import java.util.Map; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.processor.RoutingSlip; + +public class RoutingSlipMemoryLeakTest extends ContextTestSupport { + +@Override +protected void setUp() throws Exception { +deleteDirectory("target/output"); +super.setUp(); +} + +/** + * Reproducer for the memory leak: CAMEL-10048 + */ +public void testMemoryLeakInExceptionHandlerCaching() throws Exception { +int messageCount = 100; +for (int i = 0; i < messageCount; i++) { +template.sendBody("direct:start", "message " + i); +} +RoutingSlip routingSlip = context.getProcessor("memory-leak", RoutingSlip.class); +Map
[1/3] camel git commit: CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch.
Repository: camel Updated Branches: refs/heads/camel-2.16.x 63f851c29 -> c7ef72a56 refs/heads/camel-2.17.x 2207aafb6 -> be70180be refs/heads/master 40cda4711 -> e3890695b CAMEL-10048: Fixed memory leak in routing slip. Thanks to Arseniy Tashoyan for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e3890695 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e3890695 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e3890695 Branch: refs/heads/master Commit: e3890695b8cb92dff1d14b38f2876ee925d9acff Parents: 40cda47 Author: Claus IbsenAuthored: Sun Jun 12 11:08:03 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 11:10:08 2016 +0200 -- .../util/AsyncProcessorConverterHelper.java | 20 - .../camel/issues/RoutingSlipMemoryLeakTest.java | 80 2 files changed, 99 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e3890695/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java index a48e037..6b1862e 100644 --- a/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java +++ b/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorConverterHelper.java @@ -45,7 +45,7 @@ public final class AsyncProcessorConverterHelper { * It is important that this implements {@link DelegateProcessor} */ private static final class ProcessorToAsyncProcessorBridge implements DelegateProcessor, AsyncProcessor, Navigate, Service { -protected Processor processor; +protected final Processor processor; private ProcessorToAsyncProcessorBridge(Processor processor) { this.processor = processor; @@ -113,6 +113,24 @@ public final class AsyncProcessorConverterHelper { public Processor getProcessor() { return processor; } + +@Override +public boolean equals(Object o) { +if (this == o) { +return true; +} +if (o == null || getClass() != o.getClass()) { +return false; +} + +ProcessorToAsyncProcessorBridge that = (ProcessorToAsyncProcessorBridge) o; +return processor.equals(that.processor); +} + +@Override +public int hashCode() { +return processor.hashCode(); +} } public static AsyncProcessor convert(Processor value) { http://git-wip-us.apache.org/repos/asf/camel/blob/e3890695/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java b/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java new file mode 100644 index 000..7ead2b3 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/issues/RoutingSlipMemoryLeakTest.java @@ -0,0 +1,80 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.issues; + +import java.lang.reflect.Field; +import java.util.Map; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.processor.RoutingSlip; + +public class RoutingSlipMemoryLeakTest extends ContextTestSupport { + +@Override +protected void setUp() throws Exception { +deleteDirectory("target/output"); +super.setUp(); +} + +/** + * Reproducer for the memory leak: CAMEL-10048 + */ +public void testMemoryLeakInExceptionHandlerCaching() throws Exception { +int messageCount = 100; +for (int i = 0; i < messageCount; i++) { +
[3/4] camel git commit: CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down
CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2207aafb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2207aafb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2207aafb Branch: refs/heads/camel-2.17.x Commit: 2207aafb6326c80305cb4c835e721d20136b48cb Parents: a4c031b Author: Claus IbsenAuthored: Sun Jun 12 10:47:09 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 10:54:01 2016 +0200 -- .../camel/processor/DelegateAsyncProcessor.java | 4 ++ .../OnCompletionShutdownProcessorTest.java | 75 2 files changed, 79 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2207aafb/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java index 7411b8a..ddca1fe 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java @@ -83,6 +83,10 @@ public class DelegateAsyncProcessor extends ServiceSupport implements DelegatePr ServiceHelper.stopServices(processor); } +protected void doShutdown() throws Exception { +ServiceHelper.stopAndShutdownServices(processor); +} + public void process(Exchange exchange) throws Exception { AsyncProcessorHelper.process(this, exchange); } http://git-wip-us.apache.org/repos/asf/camel/blob/2207aafb/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java new file mode 100644 index 000..d1846f2 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java @@ -0,0 +1,75 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.processor; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.support.ServiceSupport; + +public class OnCompletionShutdownProcessorTest extends ContextTestSupport { + +private MyProcessor processor = new MyProcessor(); + +public void testSynchronizeComplete() throws Exception { +assertEquals("Started", processor.getStatus().name()); + +MockEndpoint mock = getMockEndpoint("mock:result"); +mock.expectedBodiesReceived("Hello World"); + +template.sendBody("direct:start", "Hello World"); + +assertMockEndpointsSatisfied(); + +context.stop(); + +assertEquals("Stopped", processor.getStatus().name()); +} + +@Override +protected RouteBuilder createRouteBuilder() throws Exception { +return new RouteBuilder() { +@Override +public void configure() throws Exception { +onCompletion().process(processor); + +from("direct:start") +.to("mock:result"); +} +}; +} + +public static class MyProcessor extends ServiceSupport implements Processor { + +public MyProcessor() { +} + +public void process(Exchange exchange) throws Exception { +exchange.getIn().setBody("Bye World"); +} + +protected void doStart() throws Exception { +// noop +} + +protected void doStop() throws
[1/4] camel git commit: CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down
Repository: camel Updated Branches: refs/heads/camel-2.16.x f44d8652e -> 63f851c29 refs/heads/camel-2.17.x a4c031b0f -> 2207aafb6 refs/heads/master 1c73dfc5e -> 40cda4711 CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d473d460 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d473d460 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d473d460 Branch: refs/heads/master Commit: d473d460717bdad1633d68fa1b15cf5c749157c0 Parents: 1c73dfc Author: Claus IbsenAuthored: Sun Jun 12 10:47:09 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 10:47:09 2016 +0200 -- .../camel/processor/DelegateAsyncProcessor.java | 4 ++ .../OnCompletionShutdownProcessorTest.java | 75 2 files changed, 79 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/d473d460/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java index 7411b8a..ddca1fe 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java @@ -83,6 +83,10 @@ public class DelegateAsyncProcessor extends ServiceSupport implements DelegatePr ServiceHelper.stopServices(processor); } +protected void doShutdown() throws Exception { +ServiceHelper.stopAndShutdownServices(processor); +} + public void process(Exchange exchange) throws Exception { AsyncProcessorHelper.process(this, exchange); } http://git-wip-us.apache.org/repos/asf/camel/blob/d473d460/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java new file mode 100644 index 000..d1846f2 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java @@ -0,0 +1,75 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.processor; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.support.ServiceSupport; + +public class OnCompletionShutdownProcessorTest extends ContextTestSupport { + +private MyProcessor processor = new MyProcessor(); + +public void testSynchronizeComplete() throws Exception { +assertEquals("Started", processor.getStatus().name()); + +MockEndpoint mock = getMockEndpoint("mock:result"); +mock.expectedBodiesReceived("Hello World"); + +template.sendBody("direct:start", "Hello World"); + +assertMockEndpointsSatisfied(); + +context.stop(); + +assertEquals("Stopped", processor.getStatus().name()); +} + +@Override +protected RouteBuilder createRouteBuilder() throws Exception { +return new RouteBuilder() { +@Override +public void configure() throws Exception { +onCompletion().process(processor); + +from("direct:start") +.to("mock:result"); +} +}; +} + +public static class MyProcessor extends ServiceSupport implements Processor { + +public MyProcessor() { +} + +public void process(Exchange exchange) throws Exception { +
svn commit: r990433 - in /websites/production/camel/content: cache/main.pageCache camel-2180-release.html
Author: buildbot Date: Sun Jun 12 08:19:48 2016 New Revision: 990433 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2180-release.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-2180-release.html == --- websites/production/camel/content/camel-2180-release.html (original) +++ websites/production/camel/content/camel-2180-release.html Sun Jun 12 08:19:48 2016 @@ -85,7 +85,7 @@ -Camel 2.18.0 release (currently in progress)http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; data-image-src="http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;>New and NoteworthyWelcome to the 2.18.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)All CamelComponents that has options to be configured now supports and includeSpring Bootauto configuration for those options, so they can easily be configured in your application.yaml file when using Spring Boot with Camel.Added Hystrix EIP as EIP pattern that uses native Netflixx Hystrix as the Circuit Breaker implementation.This requires havingcamel-hsytrixon the classpath.AddedService Call EIP as EIP pattern that allows to call a remote service in a distributed system, where the service is looked up from a service registry of some sorts, such as kubernetes, consul, etcd, zookeeper etc.Running Camel withSpring Boot now includes a Camel Health Indicator (actuator) if spring-boot-starter-actuatoris on the classpath.Improved theBean component to better match method parameter types when usingSimple language as parameter values.AddedBindyConverter that allows to implement custom data converters forBindyThe access in theRest DSL has been deprecated and no longer in use - its not part of swagger specification anymore.Camel-NATSnow uses JNATS client instead of the deprecated Java_nats one.During startup ofCamelContext the services that are used as part of routes are now deferred being started to the end of the startup process. Some IoC frameworks like Spring can otherwise causes a circular dependency issue if services are started too early. A side effect is that if service startup f ailures happen when being started later, they are now wrapped in the FailedToStartupRouteException to better pin point which route thas the problem.Improved the startup sequence ofSpring Java Config to be similar toSpring Boot that helps prevent Spring initialization errors about circular dependencies issues.Added PATCH toRest DSLAdded "starts with" and "ends with" operator to the Simplelanguage.AddedBeanIOSplitter toBeanIO that can be used with theSplitter EIP to split big payloads in streaming mode without reading the entire content into memory.Some of the AWScomponents allows t o specify ARN in the endpoint configuration.The create operation inZookeeper now creates sub paths if missing.Added support for async mode forSERVLET component to leverage Asynchronous Servlet from the Servlet 3.0 spec.Beancomponent and Bean Languagevalidates method name must be a valid according to java identifier rules, and also if parameter syntax has an ending parenthesis.You can now use@RunWith(CamelSpringBootJUnit4ClassRunner.class) to test CamelSpring Bootapplications and use the Camel test annotations fromSpring Testing such as@MockEndpoints.To turn on logging exhausted message body with the mes sage history you can configure this easily on the CamelContext level withsetLogExhaustedMessageBodyCamel-Infinispan now supports Aggregation Repository: InfinispanLocalAggregationRepository and InfinispanRemoteAggregationRepositoryTheSQL Componentand ElSqlnow supports outputType=StreamListto use an iterator for the output of the SQL query that allows to process the data in a streaming fashion such as with theSplitter EIP to process the data row by row, and load data from the database as needed.JPA now includes aJpaPollingConsumer implementation that better supportsContent Enricher usingpollEnrich to do a on-demand poll that returns either none, one or a list of entities as the result.CallingBeanwith method parameters defined usingSimple parameters, now avoids an intermediate conversion of the parameters to a String value. This ensures the passed in values when calling the bean method is using the parameter type as-is fromSimple.Camel CDI now supports importing Camel XML configuration filesCamel CDIdoes not deploy an empty Camel context bean anymore if not route builder beans nor Camel beans are deployedCamel CDIadds the@Named qualifier to Camel route management events so that it's possible to
[1/3] camel git commit: Component docs
Repository: camel Updated Branches: refs/heads/master 33cf20844 -> 1c73dfc5e Component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1cfbe4ab Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1cfbe4ab Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1cfbe4ab Branch: refs/heads/master Commit: 1cfbe4abb008221bd847032b41e0fafe0b92f9b9 Parents: 33cf208 Author: Claus IbsenAuthored: Sun Jun 12 08:36:07 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 08:36:07 2016 +0200 -- components/camel-consul/src/main/docs/consul.adoc| 4 +++- .../org/apache/camel/component/consul/ConsulConfiguration.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1cfbe4ab/components/camel-consul/src/main/docs/consul.adoc -- diff --git a/components/camel-consul/src/main/docs/consul.adoc b/components/camel-consul/src/main/docs/consul.adoc index c8ae235..167d209 100644 --- a/components/camel-consul/src/main/docs/consul.adoc +++ b/components/camel-consul/src/main/docs/consul.adoc @@ -48,6 +48,7 @@ The Consul component has no options. + // endpoint options: START The Consul component supports 22 endpoint options which are listed below: @@ -61,7 +62,7 @@ The Consul component supports 22 endpoint options which are listed below: | key | common | | String | The default key. Can be overridden by CamelConsulKey | pingInstance | common | true | boolean | Configure if the AgentClient should attempt a ping before returning the Consul instance | readTimeoutMillis | common | | Long | Read timeout for OkHttpClient -| tags | common | | String | Set tags +| tags | common | | String | Set tags. You can separate multiple tags by comma. | url | common | | String | The Consul agent URL | writeTimeoutMillis | common | | Long | Write timeout for OkHttpClient | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. @@ -83,6 +84,7 @@ The Consul component supports 22 endpoint options which are listed below: + [[Consul-Headers]] Headers ^^^ http://git-wip-us.apache.org/repos/asf/camel/blob/1cfbe4ab/components/camel-consul/src/main/java/org/apache/camel/component/consul/ConsulConfiguration.java -- diff --git a/components/camel-consul/src/main/java/org/apache/camel/component/consul/ConsulConfiguration.java b/components/camel-consul/src/main/java/org/apache/camel/component/consul/ConsulConfiguration.java index 4a93266..e64cd77 100644 --- a/components/camel-consul/src/main/java/org/apache/camel/component/consul/ConsulConfiguration.java +++ b/components/camel-consul/src/main/java/org/apache/camel/component/consul/ConsulConfiguration.java @@ -104,6 +104,9 @@ public class ConsulConfiguration { return tags; } +/** + * Set tags. You can separate multiple tags by comma. + */ public void setTags(Set tags) { this.tags = tags; }
[2/3] camel git commit: Component docs
Component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6b15b653 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6b15b653 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6b15b653 Branch: refs/heads/master Commit: 6b15b6536cae330b5a2bcadecaf1003bec27852b Parents: 1cfbe4a Author: Claus IbsenAuthored: Sun Jun 12 09:00:34 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 09:00:34 2016 +0200 -- components/camel-jms/src/main/docs/jms.adoc | 14 +- .../camel/component/jms/JmsComponent.java | 46 .../camel/component/jms/JmsConfiguration.java | 36 ++- .../springboot/JmsComponentConfiguration.java | 26 +++ 4 files changed, 109 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6b15b653/components/camel-jms/src/main/docs/jms.adoc -- diff --git a/components/camel-jms/src/main/docs/jms.adoc b/components/camel-jms/src/main/docs/jms.adoc index 672d208..147c4ea 100644 --- a/components/camel-jms/src/main/docs/jms.adoc +++ b/components/camel-jms/src/main/docs/jms.adoc @@ -211,8 +211,9 @@ Component options + // component options: START -The JMS component supports 72 options which are listed below. +The JMS component supports 74 options which are listed below. @@ -234,6 +235,8 @@ The JMS component supports 72 options which are listed below. | concurrentConsumers | int | Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener. | replyToConcurrentConsumers | int | Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. | connectionFactory | ConnectionFactory | Sets the default connection factory to be use +| username | String | Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory. +| password | String | Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory. | deliveryPersistent | boolean | Specifies whether persistent delivery is used by default. | deliveryMode | Integer | Specifies the delivery mode to be used. Possible values are Possibles values are those defined by javax.jms.DeliveryMode. NON_PERSISTENT = 1 and PERSISTENT = 2. | durableSubscriptionName | String | The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well. @@ -301,6 +304,7 @@ The JMS component supports 72 options which are listed below. + [[JMS-Endpointoptions]] Endpoint options @@ -311,8 +315,9 @@ Endpoint options + // endpoint options: START -The JMS component supports 79 endpoint options which are listed below: +The JMS component supports 83 endpoint options which are listed below: {% raw %} [width="100%",cols="2s,1,1m,1m,5",options="header"] @@ -321,6 +326,7 @@ The JMS component supports 79 endpoint options which are listed below: | destinationType | common | queue | String | The kind of destination to use | destinationName | common | | String | *Required* Name of the queue or topic to use as destination | clientId | common | | String | Sets the JMS client ID to use. Note that this value if specified must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions. If using Apache ActiveMQ you may prefer to use Virtual Topics instead. +| connectionFactory | common | | ConnectionFactory | Sets the default connection factory to be used if a connection factory is not specified for either link setTemplateConnectionFactory(ConnectionFactory) or link setListenerConnectionFactory(ConnectionFactory) | disableReplyTo | common | false | boolean | If true a producer will behave like a InOnly exchange with the exception that JMSReplyTo header is sent out and not be suppressed like in the case of InOnly. Like InOnly the producer will not wait for a reply. A consumer with this flag will behave like InOnly. This feature can be used to bridge InOut requests to another queue so that a route on the other queue will send its response directly back to the original JMSReplyTo. | durableSubscriptionName | common | | String | The durable subscriber name for specifying
[3/3] camel git commit: Component docs
Component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1c73dfc5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1c73dfc5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1c73dfc5 Branch: refs/heads/master Commit: 1c73dfc5e383a2d3182ea66c5e2ccfd056124458 Parents: 6b15b65 Author: Claus IbsenAuthored: Sun Jun 12 09:00:42 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 09:45:13 2016 +0200 -- components/camel-irc/src/main/docs/irc.adoc | 8 +--- .../camel/component/jms/JmsEndpointConfigurationTest.java| 4 ++-- components/camel-servicenow/src/main/docs/servicenow.adoc| 8 +--- components/camel-stomp/src/main/docs/stomp.adoc | 6 -- 4 files changed, 16 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1c73dfc5/components/camel-irc/src/main/docs/irc.adoc -- diff --git a/components/camel-irc/src/main/docs/irc.adoc b/components/camel-irc/src/main/docs/irc.adoc index 0de8ef3..7635d91 100644 --- a/components/camel-irc/src/main/docs/irc.adoc +++ b/components/camel-irc/src/main/docs/irc.adoc @@ -46,6 +46,7 @@ The IRC component has no options. + // endpoint options: START The IRC component supports 26 endpoint options which are listed below: @@ -58,11 +59,8 @@ The IRC component supports 26 endpoint options which are listed below: | autoRejoin | common | true | boolean | Whether to auto re-join when being kicked | namesOnJoin | common | false | boolean | Sends NAMES command to channel after joining it. link onReply has to be true in order to process the result which will have the header value irc.num = '353'. | nickname | common | | String | The nickname used in chat. -| nickPassword | common | | String | Your IRC server nickname password. -| password | common | | String | The IRC server password. | persistent | common | true | boolean | Use persistent messages. | realname | common | | String | The IRC user's actual name. -| username | common | | String | The IRC server user name. | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. | exceptionHandler | consumer (advanced) | | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored. | colors | advanced | true | boolean | Whether or not the server supports color codes. @@ -77,8 +75,11 @@ The IRC component supports 26 endpoint options which are listed below: | onQuit | filter | true | boolean | Handle user quit events. | onReply | filter | false | boolean | Whether or not to handle general responses to commands or informational messages. | onTopic | filter | true | boolean | Handle topic change events. +| nickPassword | security | | String | Your IRC server nickname password. +| password | security | | String | The IRC server password. | sslContextParameters | security | | SSLContextParameters | Used for configuring security using SSL. Reference to a org.apache.camel.util.jsse.SSLContextParameters in the Registry. This reference overrides any configured SSLContextParameters at the component level. Note that this setting overrides the trustManager option. | trustManager | security | | SSLTrustManager | The trust manager used to verify the SSL server's certificate. +| username | security | | String | The IRC server user name. |=== {% endraw %} // endpoint options: END @@ -87,6 +88,7 @@ The IRC component supports 26 endpoint options which are listed below: + [[IRC-SSLSupport]] SSL Support ^^^ http://git-wip-us.apache.org/repos/asf/camel/blob/1c73dfc5/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java -- diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java index 2b74366..8274d45 100644 ---