Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 88016 invoked from network); 21 Oct 2008 19:17:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 19:17:02 -0000 Received: (qmail 71511 invoked by uid 500); 21 Oct 2008 19:17:03 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 71496 invoked by uid 500); 21 Oct 2008 19:17:03 -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 71481 invoked by uid 99); 21 Oct 2008 19:17:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 12:17:03 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 19:15:52 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KsMiU-0008Va-45 for users@activemq.apache.org; Tue, 21 Oct 2008 12:16:30 -0700 Message-ID: <20097145.post@talk.nabble.com> Date: Tue, 21 Oct 2008 12:16:30 -0700 (PDT) From: kpalania To: users@activemq.apache.org Subject: Re: Spring JmsTemplate receive() returns null with messages in Queue In-Reply-To: <18402053.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: kpalania@yahoo.com References: <18402053.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I am running onto the same issue as well with ActiveMQ 5.1 and Spring 2.5. If I don't use JmsTemplate or use it but do a blocking call, it is fine. However, I am unable to use JmsTemplate with it being non-blocking. Any thoughts? Yohan Liyanage wrote: > > Hi, > > I tried to use JmsTemplate's receive() method for synchronous consumption > of a Queue, but the method returns 'null', even when there are messages in > the queue. > > The JmsTemplate (with a time out of two seconds) successfully receives > first messages, but after a while, it is not able to consume messages from > the queue, and returns null (timeout), even when there are messages in the > Queue (I checked through JMX). > > Then I tried using RECEIVE_TIMEOUT_INDEFINITE_WAIT, and with that, I was > able to consume about 7,8 messages (out of 50) and again, it fails > returning null. Then I tried out with NO_WAIT and this time, I was only > able to consume first message. It fails returning nulls. > > I tried this with CachingConnectionFactory / SingleConnectionFactory and > also with direct ActiveMQ ConnectionFactory. But the result is same. The > application consumes several messages, and then starts to return null, > while there are messages left in queue. > > I am using Spring 2.5.5 with ActiveMQ 5.1. > > Any suggestions are deeply appreciated. > > Thanks > > PS: I tried this with asynchronous message consumption using > MessageListener and DefaultMessageListenerContainer, and it works as > expected without this issue. > -- View this message in context: http://www.nabble.com/Spring-JmsTemplate-receive%28%29-returns-null-with-messages-in-Queue-tp18402053p20097145.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.