camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
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 GMT
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 <a href="http://camel.apache.org/routing-slip.html">Routing Slip</a>
  * pattern where the list of actual endpoints to send a message exchange to are
  * dependent on the value of a message header.
+ * <p/>
+ * 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);



Mime
View raw message