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 6CAFECF02 for ; Thu, 11 Dec 2014 17:17:29 +0000 (UTC) Received: (qmail 89895 invoked by uid 500); 11 Dec 2014 17:17:29 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 89852 invoked by uid 500); 11 Dec 2014 17:17:29 -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 89841 invoked by uid 99); 11 Dec 2014 17:17:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2014 17:17:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.8.117.5] (HELO mail1.trendhosting.net) (195.8.117.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2014 17:17:02 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.trendhosting.net (Postfix) with ESMTP id 967AB15660 for ; Thu, 11 Dec 2014 17:17:00 +0000 (GMT) Received: from mail1.trendhosting.net ([127.0.0.1]) by localhost (thp003.trendhosting.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DMnGS1IWyJit for ; Thu, 11 Dec 2014 17:16:52 +0000 (GMT) Message-ID: <5489D183.3050509@pocock.pro> Date: Thu, 11 Dec 2014 18:16:51 +0100 From: Daniel Pocock User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Throttling based on content in camel References: <1418230393897-5760505.post@n5.nabble.com> <1418312309397-5760581.post@n5.nabble.com> In-Reply-To: <1418312309397-5760581.post@n5.nabble.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 11/12/14 16:38, yogu13 wrote: > Hello Williem, > > We would like a lock to be implemented instead of any async delay as the > requirement is to allow X number of processing threads to be allowed for a > particular customer at any given point in time. If the number of requests > exceed X then the spilled ones needs to be blocked till any one of the > ongoing threads/flows ends the processing. Also the blocked threads would be > blocked for a finite time exceeding which they would be returned back. > Are you looking for throttling or can your requirement simply be met by putting a limit on the number of threads active at one time? I recently looked at the async feature of the Throttler component and I was concerned that it was not clear in the documentation whether messages processed asynchronously after a delay would still be processed within the transaction. One consequence if they are not processed within a transaction is that if the JVM stops abruptly while some messages are delayed then the messages waiting in RAM for asynchronous processing could be lost. One way to deal with this is to put the messages back into the message broker with a scheduled delivery header. The message broker is then responsible for persistence.