Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 92609 invoked from network); 18 Aug 2006 08:46:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Aug 2006 08:46:09 -0000 Received: (qmail 14613 invoked by uid 500); 18 Aug 2006 08:46:07 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 14431 invoked by uid 500); 18 Aug 2006 08:46:06 -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 14422 invoked by uid 99); 18 Aug 2006 08:46:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2006 01:46:06 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of james.strachan@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2006 01:46:04 -0700 Received: by nf-out-0910.google.com with SMTP id n29so1363866nfc for ; Fri, 18 Aug 2006 01:45:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hSRrEMEz9uYKxomj1efOP/8kgNkjPb3Cd28GtqnTY/ZalQtFSv70RpOg8VGBJwnh00j6NjGMgVnH+wAhNliLLM6CKbSTqpcdiZeB6qHdiRVsLoMIR7cQCPYZCZguc/5MYxroe12Am8BNXWzHVA7n2EQ55NFcZOY98RBohE5ZonU= Received: by 10.48.230.18 with SMTP id c18mr3734923nfh; Fri, 18 Aug 2006 01:45:43 -0700 (PDT) Received: by 10.78.173.20 with HTTP; Fri, 18 Aug 2006 01:45:42 -0700 (PDT) Message-ID: Date: Fri, 18 Aug 2006 09:45:42 +0100 From: "James Strachan" To: activemq-users@geronimo.apache.org Subject: Re: receiveNoWait problem In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 8/18/06, peter anderson wrote: > > > James Strachan writes: > > > > > There's not heaps to go on so a few questions. Which version are you > > using? Do you create the consumers up front and reuse them for each > > request? Is there a time lag between sending a message and calling > > receiveNoWait()? > > > > Note that in ActiveMQ receiveNoWait() really and truly is that - we > > don't wait a single millisecond or request-response communication with > > the broker - if there is a message available it is returned without > > any delay. > > > > Some JMS providers interpret receiveNoWait() as a 'poll the broker and > > see if there is a message available and if so fetch it'. FWIW now we > > have support for pull based consumption we could consider adding this > > feature as an option if people want it - I suspect that might be the > > behaviour you are expecting. > > > > As a workaround try using a timeout of 1000 or something? > > > > > James, > > Thanks for your prompt replay. I am using ActiveMQ 4.0.1 running under > Tomcat 5.5.17. I am calling the producer servlet first and then the consumer > servlet. Does the instantiation of the consumer servlet create the consumer? Once a consumer is created messages are dispatched asynchronously to it; so if you create a consumer then immediately call receiveNoWait() then its typically gonna return null. > Even if I leave a number of minutes between these events the messages > are still not being found. However running them in a debugger does work > which suggest receiveNoWait() is failing. Maybe its the debugger adds enough time between the createConsumer() call and the receiveNoWait() > p.s. are there any admin tools I could use to look at messages > in the queue ? Yes... http://activemq.org/site/how-can-i-monitor-activemq.html -- James ------- http://radio.weblogs.com/0112098/