Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-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 390AD90A7 for ; Mon, 9 Apr 2012 15:53:41 +0000 (UTC) Received: (qmail 48775 invoked by uid 500); 9 Apr 2012 15:53:41 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 48747 invoked by uid 500); 9 Apr 2012 15:53:41 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 48739 invoked by uid 99); 9 Apr 2012 15:53:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2012 15:53:41 +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; Mon, 09 Apr 2012 15:53:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 931C02388CCE; Mon, 9 Apr 2012 15:53:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1311290 - /camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java Date: Mon, 09 Apr 2012 15:53:17 -0000 To: commits@camel.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120409155317.931C02388CCE@eris.apache.org> Author: davsclaus Date: Mon Apr 9 15:53:17 2012 New Revision: 1311290 URL: http://svn.apache.org/viewvc?rev=1311290&view=rev Log: CAMEL-5150: Some cleanup in camel-netty according to Netty docs. Modified: camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java Modified: camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java?rev=1311290&r1=1311289&r2=1311290&view=diff ============================================================================== --- camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java (original) +++ camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java Mon Apr 9 15:53:17 2012 @@ -252,14 +252,22 @@ public class NettyProducer extends Defau if (channelFactory == null) { bossExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyTCPBoss"); workerExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyTCPWorker"); - channelFactory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor); + if (configuration.getWorkerCount() <= 0) { + channelFactory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor); + } else { + channelFactory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor, configuration.getWorkerCount()); + } } } protected void setupUDPCommunication() throws Exception { if (datagramChannelFactory == null) { workerExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyUDPWorker"); - datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor); + if (configuration.getWorkerCount() <= 0) { + datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor); + } else { + datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor, configuration.getWorkerCount()); + } } }