Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 84393 invoked from network); 25 Sep 2006 17:26:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Sep 2006 17:26:40 -0000 Received: (qmail 57599 invoked by uid 500); 25 Sep 2006 17:26:40 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 57578 invoked by uid 500); 25 Sep 2006 17:26:39 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 57569 invoked by uid 99); 25 Sep 2006 17:26:39 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2006 10:26:39 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=lists@nabble.com; spf=pass X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_10_20,HTML_MESSAGE Received-SPF: pass (idunn.apache.osuosl.org: domain nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] ([72.21.53.35:33414] helo=talk.nabble.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id CF/1D-13750-83118154 for ; Mon, 25 Sep 2006 10:26:17 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GRuDQ-0004ng-GT for activemq-users@geronimo.apache.org; Mon, 25 Sep 2006 10:26:00 -0700 Message-ID: <6491196.post@talk.nabble.com> Date: Mon, 25 Sep 2006 10:26:00 -0700 (PDT) From: Rob Lugt To: activemq-users@geronimo.apache.org Subject: Re: Topic consumer appears throttled In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2092_13226359.1159205160506" X-Nabble-From: robert.lugt@cheynecapital.com References: <6451007.post@talk.nabble.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2092_13226359.1159205160506 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit James.Strachan wrote: > > This sounds like it could be related to acknowledgements - you're > using NMS and C# as the client right? What acknowledgement mode are > you using and are you using the async or sync listener? > Hi James, your initial thought's on this were correct - the problem is due to acknowledgements. After finding that the Java client did not suffer the same problems, I took the plunge and debugged the C# NMS code. I've discovered 2 issues:- Firstly, the prefetch size for all consumers appears to be fixed at 1000 for .Net clients. The statement private int prefetchSize = 1000; in ActiveMQ\Session.cs gives the game away on that one. I tried modifying this to 2000 on my machine and hey-presto my test case worked. Of course I only had to increase the publisher to push out 2500 messaghes for the problem to return, so even though this was encouraging it was not the end of the story. Secondly, the real problem appears to be due to resource starvation within MessageConsumer.DispatchAsyncMessages(). This method will continue processing input messages as long as there are any messages queued, but the effect of this is that asynchroous acknowledgements will not be dispatched until all inbound messages have been processed. Adding a break statement into the function solves the problem. e.g: public void DispatchAsyncMessages() { while (listener != null) { IMessage message = dispatcher.DequeueNoWait(); if (message != null) { //here we add the code that if do acknowledge action. message = AutoAcknowledge(message); listener(message); break; // RAL 25/09/2006: Return to allow queued messages to be processed } else { break; } } } So, that appears to solve my little problem, although I am still a little concerned about the instability this bug managed to cause my environment earlier today. Having taken a quick look through the NMS code I can see that I'm going to have other questions e.g. Use of ThreadPool - I was expecting all callbacks for a Session to occur on a single thread Lack of programability of the .Net classes (prefetch size is an example) ... but I guess the developer forum is a better location for questions of this sort. Best regards Rob Lugt -- View this message in context: http://www.nabble.com/Topic-consumer-appears-throttled-tf2318926.html#a6491196 Sent from the ActiveMQ - User mailing list archive at Nabble.com. ------=_Part_2092_13226359.1159205160506--