Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 64797 invoked from network); 12 May 2008 07:25:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 May 2008 07:25:53 -0000 Received: (qmail 43676 invoked by uid 500); 12 May 2008 07:25:54 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 43646 invoked by uid 500); 12 May 2008 07:25:54 -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 43619 invoked by uid 99); 12 May 2008 07:25:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 00:25:54 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajdavies@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 07:25:05 +0000 Received: by py-out-1112.google.com with SMTP id f47so1691673pye.14 for ; Mon, 12 May 2008 00:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=MeZRIBOn0V6GEV0F2MD4iE0SQNxqYyKe2GIUvTV+Yus=; b=lrs7NLayTq8EbivbBh7gHB4GAI+SWJAK/QttauMtoeEZL6LkqRi/2j2CUonPBn+OPGcUPD3aQl4Fjp7sdEeo9fB4K26Svh3w6m6TIMmLNTgC4RL9r+AZIznZQMU8SfQ4NMgeESr9qZQzD2Wm5GaZNCCZfbk0rCXNhUOXzNGmp74= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=MhZTVb3QvGYRl3m3fTwQ+nSavMGWJRyFuGMJgNZAa03Cx/AcBFOzC4gtjucfBPSKkfPogFIM3B40n1uOnC8iJK5YkzGJceza/S28YPoiK+E32gUmqQlL7kLVGFSAMaClUpUabl4TqAryuAVbxF6XMOR15l8Z+wka4z6Tuet1QLk= Received: by 10.35.86.12 with SMTP id o12mr12967637pyl.37.1210577118819; Mon, 12 May 2008 00:25:18 -0700 (PDT) Received: from ?192.168.1.109? ( [81.154.166.92]) by mx.google.com with ESMTPS id n27sm10200520pyh.11.2008.05.12.00.25.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 May 2008 00:25:17 -0700 (PDT) Message-Id: <6386F14F-C826-4801-820C-88B83215F92D@gmail.com> From: Rob Davies To: users@activemq.apache.org In-Reply-To: <17136302.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: DefaultMessageListenerContainer and 5.1 Date: Mon, 12 May 2008 08:25:15 +0100 References: <17135019.post@talk.nabble.com> <17136302.post@talk.nabble.com> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org On 8 May 2008, at 22:02, BlueFox wrote: > > I just did some more checking, turns out it is the QueueBrowser that > is > causing the duplicate message problem. I have a QueueBrowser that > uses the > following code to periodically verify the queue size and perform > verification after queue size is zero. > > private static class JMSBrowser implements SessionCallback { > @Override > public Object doInJms(javax.jms.Session session) throws > JMSException { > QueueSession queueSession = (QueueSession) session; > Queue queue = queueSession.createQueue("test.queue"); > > try { > System.out.println("Monitoring queue..."); > boolean hasMoreItem = true; > > while (hasMoreItem) { > QueueBrowser browser = queueSession.createBrowser(queue); > > hasMoreItem = browser.getEnumeration().hasMoreElements(); > > browser.close(); > > System.out.println("Waiting for the queue to clear up..."); > // wait for 1s until checking > Thread.sleep(1000); > } > > } catch (Exception e) { > e.printStackTrace(); > } > > System.out.println("Queue cleared, proceed with verification"); > queueSession.close(); > > return null; > } > } > > Before upgrading to 5.1, this queue browser works correctly and only > terminates when the queue is empty. (Works in both 5.0 and 4.1.1) > However, > with new 5.1 binary I get 2 error behavior: > 1. This queue monitor will terminate even if there is still data in > the > queue > 2. Duplicate messages are delivered to consumer if monitor queue is > used. > > > BlueFox wrote: >> >> Hi I just upgraded to 5.1 and there seems to be a very weird behavior >> regarding the message redelivery. >> Before upgrade to 5.1, I had the Spring 2.5.3 and 5.0 running fine >> with >> the following setup. >> 1. I have a single producer sending and recording 100 persistent >> messages >> to a queue. >> 2. maximumRedeliveries for message is set to -1 >> 3. I use Spring DefaultMessageListenerContainer (sessionTransacted >> = true) >> to create a single exclusive consumer on the queue, and >> session.rollback(); is randomly called to simulate transaction >> failure. >> 4. When the queue size reaches 0, I verify that all 100 messages are >> correctly received and in order. >> >> Everything was working fine in 5.0, but in 5.1, I noticed that >> duplicate >> messages were received. However, if I change the cacheLevelName on >> the >> DefaultMessageListenerContainer from the default CACHE_CONSUMER to >> anything else, the test then runs fine. However, since I also have >> exponential backoff implemented for redelivery, changing the cache >> level >> will render the policy useless since the connection & session are >> recreated by the container. >> >> Thoughts? >> > > -- > View this message in context: http://www.nabble.com/DefaultMessageListenerContainer-and-5.1-tp17135019s2354p17136302.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > could you raise a jira for this issue so we can track it ? cheers, Rob http://open.iona.com/ -Enterprise Open Integration http://rajdavies.blogspot.com/