Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75EC410AF2 for ; Wed, 18 Sep 2013 16:33:01 +0000 (UTC) Received: (qmail 92630 invoked by uid 500); 18 Sep 2013 16:32:57 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 92573 invoked by uid 500); 18 Sep 2013 16:32:55 -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 92531 invoked by uid 99); 18 Sep 2013 16:32:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Sep 2013 16:32:53 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of baris@acar.org.uk designates 74.125.82.178 as permitted sender) Received: from [74.125.82.178] (HELO mail-we0-f178.google.com) (74.125.82.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Sep 2013 16:32:45 +0000 Received: by mail-we0-f178.google.com with SMTP id u57so6672095wes.37 for ; Wed, 18 Sep 2013 09:32:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:from:subject :date:to; bh=iBovdrh2+DVZeHjqtKG97TU4RyoDF2xwdE99SwGzvNs=; b=Lz2hqq+Z/w8fjd16d5mSa3AckMrKA1gMGoa31Y0oNiHlSERPIwy/lzySoNvK8MSlx8 E9enIZmuG1RUK+PMhX0rPnBqB86o+HyEEH0VC4/RH+H/qnauRHe7/WDQt/xOybhUHNzk WhcYnbrs3Ny+dmVPTyCDclJWIC0DaXRgrG7DDDkWvhg4fI0rxBJcmvYYDanxVzIC72HE TEhNpGnr8pcGZ53FuE/pFTNZPCjMHmhBFTMCKOK06swHkumqVxMaVaYtRtCW83RMcCzf nNpkuMjySeBQf4759iTJgRtFlKH1i+RC9jp4t7iGAU+9Nvoh0W5JaVhwcwh6Oz8L3op6 tqgQ== X-Gm-Message-State: ALoCoQnPVQTZtWt/8Pim25YY/Q6IehBDpZpMkKd4RdLsXSq1UApi5ZzOLM14sb9TCNhgLl2TTL8U X-Received: by 10.180.90.19 with SMTP id bs19mr7806304wib.15.1379521945190; Wed, 18 Sep 2013 09:32:25 -0700 (PDT) Received: from [172.28.93.132] ([141.228.17.193]) by mx.google.com with ESMTPSA id ey2sm3558643wib.5.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 09:32:24 -0700 (PDT) References: <31CD4B29-4F5F-474F-83D1-AFC425E6A668@acar.org.uk> In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Message-Id: <102DA727-0955-4DAD-A662-7504CF6A4867@acar.org.uk> Cc: "users@camel.apache.org" X-Mailer: iPhone Mail (10B329) From: Baris Acar Subject: Re: Aggregator lock Date: Wed, 18 Sep 2013 17:32:25 +0100 To: "users@camel.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org Thanks Claus. It is still verbose/error prone - I have to repeat it every ti= me I use such a processor (verbose) and I have to remember to do it (error p= rone). And that assumes I *know* that I have to do it in the first place - I= don't know how I can tell whether a given processor holds a lock around all= downstream processing without detailed inspection of the source.=20 Here's an extreme example to illustrate what I mean: from("direct:a") .threads(5) // set up a thread pool .bean(dostuff) // excellent, stuff is done in parallel on 5 threads - h= appy days. .aggregate(...) // I'm a good dev and remembered to RE-introduce a threa= dpool using executorService, otherwise camel will not execute any of the fol= lowing in the thread pool I made above.=20 .executorService(...) .multicast(...) // does multicast() acquire a big lock on downstream wor= k just like aggregate? .executorService(...) // (...better process downstream on another execu= tor service to be sure) .delay(1000) // maybe delay will lock too? Add another executorServic= e! .executorService(...) .log("got a msg") // how about now? Maybe log() locks all downstream threa= ds too just like aggregate! Who knows? .threads(5) // shall I just reintroduce the threadpool on every othe= r line, just to be absolutely sure? .someOtherBuiltInCamelProcessor() .threads(5) // ... if not, how can I know *when* I need to reintrodu= ce it? Camel may arbitrarily lock me out! // etc How can I reason about my system's behaviour without knowing which parts of m= y code will be executed under a seemingly arbitrary mutual exclusion lock? W= hich processors take this lock, and why? Again, thanks for your time.=20 Bar=C4=B1=C5=9F=