Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 88485 invoked from network); 16 Apr 2009 09:48:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Apr 2009 09:48:01 -0000 Received: (qmail 45460 invoked by uid 500); 16 Apr 2009 09:48:01 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 45385 invoked by uid 500); 16 Apr 2009 09:48:01 -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 45375 invoked by uid 99); 16 Apr 2009 09:48:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2009 09:48:01 +0000 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 209.85.219.164 as permitted sender) Received: from [209.85.219.164] (HELO mail-ew0-f164.google.com) (209.85.219.164) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2009 09:47:52 +0000 Received: by ewy8 with SMTP id 8so299633ewy.38 for ; Thu, 16 Apr 2009 02:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=2v059jV5MvTarfKcv68Kw5YRYSQ2xRR+YI05RQ8EEN0=; b=PJcLioNZu6OEm4PCeV7taHqL75vFyAfc0mCWVIn4cAu/sj3hWNUSsD4OXKxy+iYRNa G4olzMnVS4ysJryD/pCu/0/u7EvdHFqcmGTlH8k20+EusqIpZamC9DAEi/EeElkgjB77 iyleZWpCcEJmKnxhO6f3n6urdoi2VKGry218M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=PqK4UFZIbqDEwGmL2w8gQyqxJEW/Wh7YpFbi0hfDKGKvb4KyHsC9tYJFsZ2uYOBdNH HHztAaiQIhv5pkC+fLUfXj6v7MH73taCRkd8xf3HrBR5B727/DcHrseBKE87IwwH4OzA e6N/1qCyz7FGU8DyTym0b1rnAc/5SJriU0opw= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.210.12.18 with SMTP id 18mr5183598ebl.50.1239875250381; Thu, 16 Apr 2009 02:47:30 -0700 (PDT) In-Reply-To: <23074533.post@talk.nabble.com> References: <23074533.post@talk.nabble.com> Date: Thu, 16 Apr 2009 11:47:30 +0200 X-Google-Sender-Auth: 8e3b0a8586b6a553 Message-ID: <36e91d9d0904160247i78089318s163887c8dca954@mail.gmail.com> Subject: Re: Stomp ack:auto clears all remaining messages in the queue From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0015174bdfd8dd63390467a8f315 X-Virus-Checked: Checked by ClamAV on apache.org --0015174bdfd8dd63390467a8f315 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Michael, can you consume other ten messages afterwards? can you try to disconnect your current consumer, subscribe again and try to consume remaining messages? Cheers -- Dejan Bosanac Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Thu, Apr 16, 2009 at 11:37 AM, mjustin wrote: > > Hello, > > I compared the behaviour of the JMS client (using the ProducerTool and > ConsumerTool) and the behaviour of the Stomp client in Java. > > In both tests I start with 20 messages which I send to the queue > TOOL.DEFAULT: > > > call java -cp .;activemq-all-5.3-SNAPSHOT.jar ProducerTool > --MessageCount=20 > > Then I verify that the queue contains 20 messages: > > start http://localhost:8161/admin/browse.jsp?JMSDestination=TOOL.DEFAULT > > First I run the test of the JMS Client, consuming 10 messages using > AUTO_ACKNOWLEDGE: > > java -cp .;activemq-all-5.3-SNAPSHOT.jar ConsumerTool > --AckMode=AUTO_ACKNOWLEDGE --MaxiumMessages=10 --verbose > > Then I verify that there are 10 messages remaining in the queue, with the > 'Redelivered' fag set. > > Finally I read the remaining queue entries using the same command as > before. > > Now I start again, sending 20 messages to the queue. > > With the Stomp Java client, I read ten messages: > > public void testSubscribeWithAutoAck() throws Exception { > > String frame = "CONNECT\n" + "login: system\n" + "passcode: > manager\n\n" + Stomp.NULL; > stompConnection.sendFrame(frame); > > frame = stompConnection.receiveFrame(); > System.out.println(frame); > > frame = "SUBSCRIBE\n" + "destination:/queue/TOOL.DEFAULT" + "\n" + > "ack:auto\n\n" + Stomp.NULL; > stompConnection.sendFrame(frame); > > for (int i=0; i < 10; i++) { > frame = stompConnection.receiveFrame(); > System.out.println(frame); > } > > frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL; > stompConnection.sendFrame(frame); > > System.out.println("Disconnect frame sent"); > } > > > Now I check the queue in the admin console: there should be ten remaining > messages in the queue, but the queue is empty. > > All 20 messages have been sent to the client over the Stomp adapter (as I > can see in the broker log), but the broker does not realize that the client > has received only 10. > > So the difference between the JMS and the Stomp interface is that the JMS > interface allows to fetch some messages using automatic acknowledge, while > the Stomp client (using ack:auto) would require to read all remaining > messages - if it stops receiving, all remaining messages are lost. > > I am not sure if this is 'as designed', however it seems to make automatic > acknowledgement in the Stomp interface very fragile. > > Best Regards > Michael Justin > -- > View this message in context: > http://www.nabble.com/Stomp-ack%3Aauto-clears-all-remaining-messages-in-the-queue-tp23074533p23074533.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > --0015174bdfd8dd63390467a8f315--