Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 47933 invoked from network); 27 Nov 2006 02:30:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2006 02:30:52 -0000 Received: (qmail 34239 invoked by uid 500); 27 Nov 2006 02:31:01 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 34218 invoked by uid 500); 27 Nov 2006 02:31:01 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 34202 invoked by uid 99); 27 Nov 2006 02:31:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 18:31:01 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.235.254.11] (HELO exodus.exist.com) (209.235.254.11) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 18:30:47 -0800 Received: from [192.168.241.197] ([58.71.14.245]) (authenticated bits=0) by exodus.exist.com (8.13.1/8.13.1) with ESMTP id kAR2UFdB019349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 26 Nov 2006 21:30:18 -0500 Message-ID: <456A4DBF.4070404@exist.com> Date: Mon, 27 Nov 2006 10:30:23 +0800 From: Jonas Lim User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: activemq-dev@geronimo.apache.org Subject: Re: Message Expiry References: <6711322.post@talk.nabble.com> <452A1ED9.2010208@exist.com> <7539449.post@talk.nabble.com> In-Reply-To: <7539449.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, That's odd. I ran the same test case on 4.0.2 and I can't seem to reproduced the problem. Would you mind posting a snippet of your code so we could take a look at it? Btw, please make sure that the setTimeToLive method is called before sending the message. You could also try running the sample code below and see if it works for you ..... connection.start(); long timeToLive = 1000; MessageProducer producer = session.createProducer(null); p.setTimeToLive(timeToLive ); Queue myQueue = session.createQueue("QUEUE"); Message m = session.createTextMessage("message"); producer.send(myQueue, m); // sleeps a second longer than the expiration time. // Basically waits till queue expires. Thread.sleep(timeToLive + 1000); //myQueue should return null since it already expired MessageConsumer consumer = session.createConsumer(myQueue); Message msg = consumer.receive(1000); ...... Regards, Jonas Sergey wrote: > Hallo, > > I've got the same problem. Expiration dosn't seem to work. I'm using 4.0.2. > > > > jlim wrote: > >> Hi, >> >> Hmm - which version of ActiveMQ are you using? The message should have >> expired and should not be consumed after the timetolive has elapsed. >> >> You can try looking on some of the test cases and see if you can >> reproduce the issue: >> >> ie. >> https://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java >> >> btw, I tested this using trunk and appears to work ok :) >> >> >> Regards, >> Jonas >> >> >> Christopher_Ong wrote: >> >>> I set the timetolive for a message as 1s and y after that period, the msg >>> still remain there? Shouldn't be it wil automatically been deleted or >>> send >>> to dead msg queue? >>> >>> >> > >