Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 81332 invoked from network); 26 Oct 2006 06:33:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 06:33:07 -0000 Received: (qmail 48344 invoked by uid 500); 24 Oct 2006 18:33:17 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 48333 invoked by uid 500); 24 Oct 2006 18:33:17 -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 48324 invoked by uid 99); 24 Oct 2006 18:33:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2006 11:33:17 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2006 11:33:02 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GcR4s-0000sK-7X for activemq-users@geronimo.apache.org; Tue, 24 Oct 2006 11:32:42 -0700 Message-ID: <6978831.post@talk.nabble.com> Date: Tue, 24 Oct 2006 11:32:42 -0700 (PDT) From: Anulok To: activemq-users@geronimo.apache.org Subject: Re: NMS C# client Recieve not timing out In-Reply-To: <6961449.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: errol_s@hotmail.com References: <6961449.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org How about just putting in in a separate thread and that way you could let the thread that calls consumer.Receive() just hang until another message arrives while your main thread does some other work? robottaway wrote: > > I am guessing that the Recieve function on the ActiveMQ message consumer > in the NMS api should return null when no messages are on a queue. I am > not seeing this. I try to check for messages after receive, making sure > that they are not null. What happens is that execution stops at the > consumer.Receive() call, and does not move forward until a message comes > into the queue. > > What I am trying to do is the following: I have a windows service that > will consume messages from a queue. When it starts up I want to try and > read all messages on the queue. Once the initial messages are done being > read I want to have the consumer stop, and another consumer with a > MessageListener takes over. I register the MessageListener on another > consumer so that any new messages that come into the queue will be read > asynchronously. > > I can make one or the other work, but not both. This is because the > Receive function does not return when there are no messages on the queue I > am reading from. > -- View this message in context: http://www.nabble.com/NMS-C--client-Recieve-not-timing-out-tf2497328.html#a6978831 Sent from the ActiveMQ - User mailing list archive at Nabble.com.