Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-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 DAF5918E2E for ; Fri, 22 Jan 2016 17:16:18 +0000 (UTC) Received: (qmail 93714 invoked by uid 500); 22 Jan 2016 17:16:17 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 93642 invoked by uid 500); 22 Jan 2016 17:16:17 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 93626 invoked by uid 99); 22 Jan 2016 17:16:17 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2016 17:16:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 746611A088A for ; Fri, 22 Jan 2016 17:04:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id PqOvUO3sMypB for ; Fri, 22 Jan 2016 17:04:17 +0000 (UTC) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 7910F23016 for ; Fri, 22 Jan 2016 17:04:16 +0000 (UTC) Received: by mail-wm0-f48.google.com with SMTP id b14so142230121wmb.1 for ; Fri, 22 Jan 2016 09:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=Xtd+kWFkF1dzqxEtLfit8LAc56iqW5jjSuQ9HcWLgY4=; b=TDmFXsDOj90ugVQ4XTVIz9X00E+ypOBhtPIWBoqxtl640nd7n/0bq5i+Qa2P4jzFxD avi0WHwbiXR/Ij2C4QElAOu74Cq9myh0F0kkG4M09uzX/UlGNo0o41Nx1HsoTOtIM6Dd a+F74U1YyjA+h4tGUiGSz3Yul5LfBSwKJHdHyZhnVwhruQiqqIaaZIh0ILucXx5WrDTt OUo7NYJ8ud9G45gGYlkpNHfzNIe++OklSzfWWnpb7W5aUDz2otofGcsvMqpJ+adCrXdl wMmvkenWmBEyUe4SFw2bte1/MjqxHpWNuyneEx9IOU5fPLNuxuW7AAnChk9qST8V/Hx/ ebsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=Xtd+kWFkF1dzqxEtLfit8LAc56iqW5jjSuQ9HcWLgY4=; b=dP+AoDNbDwrUM51lm69oXym4Xo80JxFWBYQI0a+pu05iggYyU/8AsRtZoMht4ghYvj ruFKsjzCuW/PCV0mSi2UgNnoCTL/2DUsAXVUxppbciMkQcAVa/ejTSOoP8WkZ42J4SA9 n/lWHefVN3BDnMilGvACFdwMBwK8oCtb+ulB22hC9YB3a8JR/DqTmhynjMdTx8/oVBoC eSKHC7yO7OxiWIS/J1WVGcGz9U2KTsoCO42AHTjQVgzKJ58hM6y7oF8woed6RYfGOWvH 8pgLOkuIBw2BWxxqKLoYfCFpIWzaJAReVMGSXt/iAmcdgtijXzD5zJN5qcRvLBb3l4GP uoEA== X-Gm-Message-State: AG10YOSMwjnCLsC7o+kyhXXGBVNfavFpe06iGxtm8TIF0JibSUdiF8G1psrI/1o8Q+/mSQ== X-Received: by 10.28.113.220 with SMTP id d89mr4893211wmi.56.1453482256219; Fri, 22 Jan 2016 09:04:16 -0800 (PST) Received: from [192.168.2.7] ([5.179.70.21]) by smtp.googlemail.com with ESMTPSA id fx8sm6780639wjb.13.2016.01.22.09.04.14 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 09:04:15 -0800 (PST) Subject: Re: How to limit concurrent requests served by resource? To: users@cxf.apache.org References: <5698E3BE.7000303@gmail.com> <569CC7A2.7010507@gmail.com> From: Sergey Beryozkin Message-ID: <56A2610D.3080000@gmail.com> Date: Fri, 22 Jan 2016 17:04:13 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <569CC7A2.7010507@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I might have some time to look at https://issues.apache.org/jira/browse/CXF-6610 before 3.1.5 gets released if not then we will do for 3.1.6 It should be a very basic update, say if an optional property "abortWhenThresholdIsReached" is set then a specific exception is thrown, and either JAXWS or JAXRS mappers can then map it to 503 Sergey On 18/01/16 11:08, Sergey Beryozkin wrote: > Hi, > jaxrs:server can have features or native CXF interceptors registered > within jaxrs:features and jaxrs:inInterceptors (or > jaxrs:outInterceptors), so that demo should work the same way with JAXRS > servers it works with JAXWS. > Unfortunately I haven't experimented much myself yet, though as I said > one thing we noticed that supporting optionally returning 503 instead of > suspending the overflowing client requests will be needed - that should > be not be difficult to do. > > Cheers, Sergey > > On 18/01/16 10:54, Vjacheslav V. Borisov wrote: >> Sergey, how should we adopt this approach to jax-rs services? >> >> Which is there jax-rs analogs to AbstractPhaseInterceptor ? >> >> >> 2016-01-15 16:19 GMT+04:00 Sergey Beryozkin : >> >>> Hi >>> >>> CXF ships its own throttling feature, Dan did it, see >>> >>> >>> https://fisheye6.atlassian.com/browse/cxf/distribution/src/main/release/samples/throttling >>> >>> >>> The threads will be temporarily suspended If the threshold is reached. >>> One thing that still needs to be done is to support actually >>> returning 503 >>> (if preferred) as opposed to suspending the clients. >>> >>> Sergey >>> >>> >>> On 15/01/16 11:12, Vjacheslav V. Borisov wrote: >>> >>>> Hi, >>>> >>>> How to limit concurrent requests served by specific resource, or by >>>> application iteself? >>>> >>>> Found this thread >>>> >>>> http://stackoverflow.com/questions/5563442/how-to-set-limit-to-the-number-of-concurrent-request-in-servlet >>>> >>>> >>>> Should i do something like showed in accepted answer, >>>> or cxf has his limit configuration ? >>>> >>>> >>> >>> -- >>> Sergey Beryozkin >>> >>> Talend Community Coders >>> http://coders.talend.com/ >>> >> > > -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/