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 Ibsen <davscl...@apache.org> Authored: Sun Jun 12 11:39:46 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> 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 * <p/> * This is similar to how multicast processor does. */ - static final class PreparedErrorHandler extends KeyValueHolder<RouteContext, Processor> { + static final class PreparedErrorHandler extends KeyValueHolder<String, Processor> { - 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());