Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 63030 invoked from network); 10 Jul 2007 14:50:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jul 2007 14:50:21 -0000 Received: (qmail 40647 invoked by uid 500); 10 Jul 2007 14:50:24 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 40411 invoked by uid 500); 10 Jul 2007 14:50:23 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 40402 invoked by uid 99); 10 Jul 2007 14:50:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2007 07:50:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of james.strachan@gmail.com designates 66.249.82.225 as permitted sender) Received: from [66.249.82.225] (HELO wx-out-0506.google.com) (66.249.82.225) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2007 07:50:19 -0700 Received: by wx-out-0506.google.com with SMTP id i30so1307448wxd for ; Tue, 10 Jul 2007 07:49:58 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ovCF3BY2/x6Py5rdeUj/J0MiUCXXrLOCZYSQd5Tvk3pzrQtlZEMrOjwa4Tcxz+LKYcCHHc/QjsRy1y4csHSvP5k4SCzyRQD/L/yGaUFlYZ3G5accwKmkNx40tbsrttN4a1JQI53HyYZycvB0DvJSU59Gqhuq4qrWLx5lUMn5z8s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EbiwVOUirSKbIPjII7MzDNkEvUVb2ZAWHqXhw35xAfprrJHDlr+TJqnX1JtuGWAxpcdI80JDiQYRjhZzHcrqk5N9az/peQhkY8LSqcXbP/BdQ6JFewpxQofRvR6FGnNtpz99H5E6pv7A7Ia99oUz2fQQDUtDKRqyo3/hyYN9FS0= Received: by 10.90.105.19 with SMTP id d19mr2965100agc.1184078998728; Tue, 10 Jul 2007 07:49:58 -0700 (PDT) Received: by 10.90.63.14 with HTTP; Tue, 10 Jul 2007 07:49:58 -0700 (PDT) Message-ID: Date: Tue, 10 Jul 2007 15:49:58 +0100 From: "James Strachan" To: users@activemq.apache.org, jima@comware.com.au Subject: Re: Creating MessageConsumer overhead In-Reply-To: <469385B8.9010204@comware.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11476576.post@talk.nabble.com> <46919231.8000406@exist.com> <11515312.post@talk.nabble.com> <11517383.post@talk.nabble.com> <469385B8.9010204@comware.com.au> X-Virus-Checked: Checked by ClamAV on apache.org On 7/10/07, Jim Alateras wrote: > Just a general question about the overhead on creating MessageConsumer > instances. Is it efficient to create MessageConsumers for relatively > short conversations. > > For example a loop which basically checks for a message, executes a > policy on the message and then sleeps for some interval. Would it be > efficient to create a new MessageConsumer at the start of each iteration. Its mostly a latency cost on the client side. There's some overhead; particularly if the consumer is on a large queue using selectors with filter most messages; as each new consumer created causes the broker to iterate through all pending messages attempting to push them to the new consumer. So the faster approach will always to be to create consumers up front and share them- then use say Message Groups to keep conversations apart - but otherwise creating consumers for relatively short conversations should be fine. -- James ------- http://macstrac.blogspot.com/