Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37E4D7887 for ; Mon, 19 Dec 2011 12:40:09 +0000 (UTC) Received: (qmail 3493 invoked by uid 500); 19 Dec 2011 12:40:09 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 3459 invoked by uid 500); 19 Dec 2011 12:40:09 -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 3452 invoked by uid 99); 19 Dec 2011 12:40:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Dec 2011 12:40:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED 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, 19 Dec 2011 12:40:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 291F223889E1 for ; Mon, 19 Dec 2011 12:39:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@camel.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111219123947.291F223889E1@eris.apache.org> 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); + } + }); } }