camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1220721 - in /camel/branches/camel-2.7.x: ./ camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointDelayUoWTest.java
Date Mon, 19 Dec 2011 12:39:46 GMT
Author: davsclaus
Date: Mon Dec 19 12:39:46 2011
New Revision: 1220721

URL: http://svn.apache.org/viewvc?rev=1220721&view=rev
Log:
CAMEL-4795: Fixed issue with throttler/delayer in async delayed mode, calling exchange done
2 times under certain conditions.

Added:
    camel/branches/camel-2.7.x/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointDelayUoWTest.java
      - copied unchanged from r1220717, camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointDelayUoWTest.java
Modified:
    camel/branches/camel-2.7.x/   (props changed)
    camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 19 12:39:46 2011
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531,1214058,1214648
-/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526,1214639
+/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531,1214058,1214648,1220717
+/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526,1214639,1220711

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java?rev=1220721&r1=1220720&r2=1220721&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java
(original)
+++ camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java
Mon Dec 19 12:39:46 2011
@@ -59,9 +59,18 @@ public abstract class DelayProcessorSupp
             if (!isRunAllowed()) {
                 exchange.setException(new RejectedExecutionException("Run is not allowed"));
             }
-            DelayProcessorSupport.super.process(exchange, callback);
-            // signal callback we are done async
-            callback.done(false);
+
+            // process the exchange now that we woke up
+            DelayProcessorSupport.super.process(exchange, new AsyncCallback() {
+                @Override
+                public void done(boolean doneSync) {
+                    log.trace("Delayed task done for exchangeId: {}", exchange.getExchangeId());
+                    // we must done the callback from this async callback as well, to ensure
callback is done correctly
+                    // must invoke done on callback with false, as that is what the original
caller would
+                    // expect as we returned false in the process method
+                    callback.done(false);
+                }
+            });
         }
     }
 



Mime
View raw message