Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ADBE3200BBB for ; Thu, 10 Nov 2016 10:13:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AC5A9160B01; Thu, 10 Nov 2016 09:13:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F36A8160AF6 for ; Thu, 10 Nov 2016 10:13:57 +0100 (CET) Received: (qmail 58068 invoked by uid 500); 10 Nov 2016 09:13:57 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 58052 invoked by uid 99); 10 Nov 2016 09:13:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2016 09:13:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3DE55C07AD for ; Thu, 10 Nov 2016 09:13:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.487 X-Spam-Level: *** X-Spam-Status: No, score=3.487 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id W42-NOZc1KeA for ; Thu, 10 Nov 2016 09:13:54 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2F2595F30E for ; Thu, 10 Nov 2016 09:13:53 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mbob.nabble.com (Postfix) with ESMTP id 8138135AA99D for ; Thu, 10 Nov 2016 01:04:38 -0800 (PST) Date: Thu, 10 Nov 2016 02:13:51 -0700 (MST) From: sohrab To: users@camel.apache.org Message-ID: <1478769231853-5789988.post@n5.nabble.com> Subject: NotifyBuilder Behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Thu, 10 Nov 2016 09:13:58 -0000 I've read the page on NotifyBuilder but I don't think I really understood how it works. So I wrote below test case to verify it. The results confound me. (The Groovy script is standalone and fully functioning so feel free to run it locally.) Code === @Grab(group='org.apache.camel', module = 'camel-core', version='2.15.1') import java.util.concurrent.TimeUnit import org.apache.camel.builder.* import org.apache.camel.impl.DefaultCamelContext def context = new DefaultCamelContext() context.addRoutes(new RouteBuilder() { void configure() { from('direct:route1').routeId('route1') .log('route 1 started') .to('direct:route2') .log('route 1 ended') from('direct:route2').routeId('route2') .log('route 2 started') .to('direct:route3') .log('route 2 ended') from('direct:route3').routeId('route3') .log('route 3 started and ended') } }) context.start() def notifies = [ new NotifyBuilder(context).from('direct:route1').whenExactlyDone(1).create(), new NotifyBuilder(context).from('direct:route2').whenExactlyDone(1).create(), new NotifyBuilder(context).from('direct:route3').whenExactlyDone(1).create(), new NotifyBuilder(context).whenExactlyDone(1).from('direct:route1').create(), new NotifyBuilder(context).whenExactlyDone(1).from('direct:route2').create(), new NotifyBuilder(context).whenExactlyDone(1).from('direct:route3').create() ] context.createProducerTemplate().requestBody 'direct:route1', 'something' notifies.eachWithIndex { it, i -> println "$i: ${it.matches()}" } STDOUT === 0: true 1: false 2: false 3: true 4: true 5: true I understand the predicates are stacked but can someone please explain the above behaviour to me? -- View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-Behaviour-tp5789988.html Sent from the Camel - Users mailing list archive at Nabble.com.