Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-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 B1EC1DC52 for ; Fri, 16 Nov 2012 11:27:22 +0000 (UTC) Received: (qmail 79650 invoked by uid 500); 16 Nov 2012 11:27:22 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 79345 invoked by uid 500); 16 Nov 2012 11:27:21 -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 79318 invoked by uid 99); 16 Nov 2012 11:27:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2012 11:27:21 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gary.tully@gmail.com designates 209.85.214.171 as permitted sender) Received: from [209.85.214.171] (HELO mail-ob0-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2012 11:27:16 +0000 Received: by mail-ob0-f171.google.com with SMTP id dn14so2706319obc.2 for ; Fri, 16 Nov 2012 03:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Hw2P02b3QgcZry1VAiFaCjgtIpVWF56xvdMzw5MuL9I=; b=uI4s7p30jRYmbGZEhIhZwNSrVT3v4jTNjbkNLKNgcRTtPuE+sn/Rkd79ZmxNYoOvlX 2pK7LVCStDNMuj/VvY3F2sCkO883AlUPlJDmTS5cv4IwGVV4iVvIkoN9BIktEfGL97wQ tzdo+xKDKfTcQ9wrwnYxy7hamt4EXLmz0x/13IVYrDC3WAq8ZVz+VpnQvSVhP8CsmvS7 +Vw4Ud9lKwlbNUKxJpQnWINXgtrHht7UpZCaQtuSpU9YrdwPUeMhU20o/vKQFzyFNknO BiV9A3hnFUGxFvL2/+dX+lpGpkTVJt4iZsgrqX1HM47U5A/54VFASC4fSTC+hDPuhjfW 8D0A== MIME-Version: 1.0 Received: by 10.60.14.6 with SMTP id l6mr3526044oec.87.1353065216007; Fri, 16 Nov 2012 03:26:56 -0800 (PST) Received: by 10.76.82.162 with HTTP; Fri, 16 Nov 2012 03:26:55 -0800 (PST) In-Reply-To: <1353045855631-4659431.post@n4.nabble.com> References: <1352993211594-4659398.post@n4.nabble.com> <1353045855631-4659431.post@n4.nabble.com> Date: Fri, 16 Nov 2012 11:26:55 +0000 Message-ID: Subject: Re: jms.prefetchPolicy.queuePrefetch=1 means 2 outstanding messages? From: Gary Tully To: "users@activemq.apache.org" Content-Type: multipart/alternative; boundary=e89a8fb201128edcfb04ce9b0b46 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8fb201128edcfb04ce9b0b46 Content-Type: text/plain; charset=ISO-8859-1 you still need to tune the prefetch. the prefetch extension is used when a message is delivered but not acked, such that the broker and dispatch another message, the idea being that there will always be prefetch num messages pending. It also allows a transaction batch to exceed the prefetch value. So with prefetch=1, one message is dispatched, and when the broker gets a delivered ack, it used the prefetch extension to deliver another. With usePrefetchExtension false, it won't dispatch another message till the original is acked. On 16 November 2012 06:04, himanshu_s83 wrote: > Ok. Sure, will try that. So I assume that with usePrefetchExtension=false, > it > doesn't matter whats the prefetch size. Correct? > > With Prefetch Size 0 we initially saw messages getting consumed faster but > after a while, consumption rate became dead slow and queue size kept on > increasing to a very high value, even after increasing consumers. So we > reverted to earlier value of 1. > > We are using 5.0 version of ActiveMQ and consumers are created in a > threadpool with each consumer thread having a dedicated session. Our > threaded model is straightforward: > > while(1) { > consumer.receive() //threads block here for new message > processMessgae() //message get processed here > acknowledge() //message get acknowledged > } > > In addition to above, we are catching exceptions and calling > "session.recover()" appropriately. > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/jms-prefetchPolicy-queuePrefetch-1-means-2-outstanding-messages-tp4659398p4659431.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- http://redhat.com http://blog.garytully.com --e89a8fb201128edcfb04ce9b0b46--