Return-Path: Delivered-To: apmail-camel-commits-archive@www.apache.org Received: (qmail 80030 invoked from network); 21 Jun 2010 14:39:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Jun 2010 14:39:16 -0000 Received: (qmail 31166 invoked by uid 500); 21 Jun 2010 14:39:16 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 31115 invoked by uid 500); 21 Jun 2010 14:39:16 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 31108 invoked by uid 99); 21 Jun 2010 14:39:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jun 2010 14:39:16 +0000 X-ASF-Spam-Status: No, hits=-1544.9 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jun 2010 14:39:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 74BA32388994; Mon, 21 Jun 2010 14:38:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r956603 - in /camel/trunk/camel-core/src/main/java/org/apache/camel/processor: Pipeline.java RoutingSlip.java Date: Mon, 21 Jun 2010 14:38:29 -0000 To: commits@camel.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100621143829.74BA32388994@eris.apache.org> Author: davsclaus Date: Mon Jun 21 14:38:29 2010 New Revision: 956603 URL: http://svn.apache.org/viewvc?rev=956603&view=rev Log: CAMEL-2835: Routing slip EIP now fully supports async routing engine. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java?rev=956603&r1=956602&r2=956603&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java Mon Jun 21 14:38:29 2010 @@ -141,9 +141,9 @@ public class Pipeline extends MulticastP // implement asynchronous routing logic in callback so we can have the callback being // triggered and then continue routing where we left boolean sync = asyncProcessor.process(exchange, new AsyncCallback() { - public void done(boolean sync) { + public void done(boolean doneSync) { // we only have to handle async completion of the pipeline - if (sync) { + if (doneSync) { return; } @@ -178,8 +178,8 @@ public class Pipeline extends MulticastP } nextExchange = createNextExchange(nextExchange); - sync = process(original, nextExchange, callback, processors, processor); - if (!sync) { + doneSync = process(original, nextExchange, callback, processors, processor); + if (!doneSync) { if (LOG.isTraceEnabled()) { LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " is continued being processed asynchronously"); } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java?rev=956603&r1=956602&r2=956603&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java Mon Jun 21 14:38:29 2010 @@ -47,6 +47,10 @@ import static org.apache.camel.util.Obje * Implements a Routing Slip * pattern where the list of actual endpoints to send a message exchange to are * dependent on the value of a message header. + *

+ * This implementation mirrors the logic from the {@link org.apache.camel.processor.Pipeline} in the async variation + * as the failover load balancer is a specialized pipeline. So the trick is to keep doing the same as the + * pipeline to ensure it works the same and the async routing engine is flawless. */ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Traceable { private static final transient Log LOG = LogFactory.getLog(RoutingSlip.class); @@ -163,7 +167,7 @@ public class RoutingSlip extends Service if (LOG.isTraceEnabled()) { LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " is continued being processed asynchronously"); } - // the remainder of the pipeline will be completed async + // the remainder of the routing slip will be completed async // so we break out now, then the callback will be invoked which then continue routing from where we left here return false; } @@ -372,7 +376,7 @@ public class RoutingSlip extends Service } private void updateRoutingSlipHeader(Exchange current) { - // only update the header value which used as the routingslip + // only update the header value which used as the routing slip if (header != null) { Message message = getResultMessage(current); String oldSlip = message.getHeader(header, String.class);