Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-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 040A79190 for ; Sat, 21 Apr 2012 07:24:46 +0000 (UTC) Received: (qmail 6056 invoked by uid 500); 21 Apr 2012 07:24:45 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 5983 invoked by uid 500); 21 Apr 2012 07:24:44 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 5958 invoked by uid 99); 21 Apr 2012 07:24:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Apr 2012 07:24:43 +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; Sat, 21 Apr 2012 07:24:42 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4E5DC238896F; Sat, 21 Apr 2012 07:24:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1328598 - in /cxf/trunk: api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java Date: Sat, 21 Apr 2012 07:24:22 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120421072422.4E5DC238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ay Date: Sat Apr 21 07:24:21 2012 New Revision: 1328598 URL: http://svn.apache.org/viewvc?rev=1328598&view=rev Log: [CXF-4257] add an option for RejectedExecutionException handling for onway Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java?rev=1328598&r1=1328597&r2=1328598&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java Sat Apr 21 07:24:21 2012 @@ -150,11 +150,17 @@ public class OneWayProcessorInterceptor lock.wait(20); } } catch (RejectedExecutionException e) { - //the executor queue is full, so run the task in the caller thread LOG.warning( "Executor queue is full, run the oneway invocation task in caller thread." + " Users can specify a larger executor queue to avoid this."); - chain.resume(); + // only block the thread if the prop is unset or set to false, otherwise let it go + if (!MessageUtils.isTrue( + message.getContextualProperty( + "org.apache.cxf.oneway.rejected_execution_exception"))) { + //the executor queue is full, so run the task in the caller thread + chain.resume(); + } + } catch (InterruptedException e) { //ignore - likely a busy work queue so we'll just let the one-way go } Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java?rev=1328598&r1=1328597&r2=1328598&view=diff ============================================================================== --- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java (original) +++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java Sat Apr 21 07:24:21 2012 @@ -202,11 +202,16 @@ final class InternalContextUtils { } }); } catch (RejectedExecutionException e) { - //the executor queue is full, so run the task in the caller thread LOG.warning( "Executor queue is full, use the caller thread." + " Users can specify a larger executor queue to avoid this."); - inMessage.getInterceptorChain().resume(); + // only block the thread if the prop is unset or set to false, otherwise let it go + if (!MessageUtils.isTrue( + inMessage.getContextualProperty( + "org.apache.cxf.oneway.rejected_execution_exception"))) { + //the executor queue is full, so run the task in the caller thread + inMessage.getInterceptorChain().resume(); + } } } }