Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 19525 invoked from network); 9 Feb 2009 17:27:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 17:27:19 -0000 Received: (qmail 10654 invoked by uid 500); 9 Feb 2009 17:27:19 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 10292 invoked by uid 500); 9 Feb 2009 17:27:18 -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 10281 invoked by uid 99); 9 Feb 2009 17:27:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 09:27:18 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of roger.hoover@gmail.com designates 209.85.217.20 as permitted sender) Received: from [209.85.217.20] (HELO mail-gx0-f20.google.com) (209.85.217.20) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 17:27:09 +0000 Received: by gxk13 with SMTP id 13so1875175gxk.14 for ; Mon, 09 Feb 2009 09:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Aj6kLHpzOiF62URjP8RTWlWl/Ze/U+vFUjq0o96AAf4=; b=e7mLgh/ICliM7SYSgjrl9K1q+31smqSuhXtfOcurTWyo9TKRc6l1gtIkRcu+HBCAsu dVeb7ckDs5qjHb/ALuUJVvccwXk3W6RDnLRSR0BDB8P+j1R3Nu+yY+wTDel5GoL1W4bK aMZmc186zfdYzEpIpSrRziCC3kfQ0LAwns5/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=L/5g9A3Cj9Q6bbmeKrBfGaI/SSfU1SKAaHru0N7cPHsXRym8F1CNnojdeRUCA9EgQP ZzuBp9dbNOiM0heQsz9vlTSZsd/7auNOHBXiTQ0NGwern18f0ADeaZxIH1DP/PNscTFH +lt4qep+N5929wl8J+TwWva4l1tL49z8pdd7M= MIME-Version: 1.0 Received: by 10.142.105.10 with SMTP id d10mr3020408wfc.71.1234200407479; Mon, 09 Feb 2009 09:26:47 -0800 (PST) In-Reply-To: <36e91d9d0902090310i6a8ce9c5k21cb9cc4496e382b@mail.gmail.com> References: <44cb1ba30901230118o21c60779lf06c44064eabd92f@mail.gmail.com> <36e91d9d0901230831t4a7e8598s3c0131a9cc33c13d@mail.gmail.com> <44cb1ba30901231024m5682038cncbab8f1b0eedf1dc@mail.gmail.com> <36e91d9d0901260019n5787b555o7acac7f581e72444@mail.gmail.com> <44cb1ba30902061858r34fa4910ud0b48bc5efcf80dd@mail.gmail.com> <36e91d9d0902090310i6a8ce9c5k21cb9cc4496e382b@mail.gmail.com> Date: Mon, 9 Feb 2009 09:26:47 -0800 Message-ID: <44cb1ba30902090926q1c27b72rec0f6a1277395d6@mail.gmail.com> Subject: Re: Problems with acknowledge mode order (STOMP) From: Roger Hoover To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=001636e1fcb6de945004627fac77 X-Virus-Checked: Checked by ClamAV on apache.org --001636e1fcb6de945004627fac77 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks. That works! On Mon, Feb 9, 2009 at 3:10 AM, Dejan Bosanac wrote: > Hi Roger, > > this is the normal behavior of the "client" acknowledgment mode. The broker > acknowledges all messages up to the one you specified. So when you ack > message 3, message 2 is also acked so when you try to ack it later again > you > receive an error. > > The solution for your use case would be to use "client-individual" ack mode > as described here > > http://issues.apache.org/activemq/browse/AMQ-1874 > > Unfortunately it isn't document anywhere, but I have it now on my todo > list. > > Cheers > -- > Dejan Bosanac > > Open Source Integration - http://fusesource.com/ > ActiveMQ in Action - http://www.manning.com/snyder/ > Blog - http://www.nighttale.net > > > On Sat, Feb 7, 2009 at 3:58 AM, Roger Hoover > wrote: > > > Hi Dejan, > > > > Thanks again for the quick response. Here is a very simple Perl unit > test > > that illustrates the bug. I don't do too much work with Java so if you > > really don't mind translating it, I appreciate it. > > > > Thanks, > > > > Roger > > > > #!/usr/bin/env perl > > > > use strict; > > use Net::Stomp; > > use Data::Dumper; > > use Test::More tests => 1; > > > > my $stomp = Net::Stomp->new( { 'hostname' => 'localhost', 'port' => > '61613' > > } ); > > $stomp->connect( { 'login' => 'hello', 'passcode' => 'there' } ); > > > > #Make sure queue is empty from previous tests > > while($stomp->can_read({'timeout' => 1})) { > > $stomp->receive_frame(); > > } > > > > # Enqueue three test messages > > $stomp->send({ 'destination' => '/queue/testOutOfOrderAck', 'body' => > > 'message1' } ); > > $stomp->send({ 'destination' => '/queue/testOutOfOrderAck', 'body' => > > 'message2' } ); > > $stomp->send({ 'destination' => '/queue/testOutOfOrderAck', 'body' => > > 'message3' } ); > > > > # Subscribe to the queue (with prefetchSize >= 3) and receive the three > > test > > messages > > $stomp->subscribe( > > { destination => '/queue/testOutOfOrderAck', > > 'ack' => 'client', > > 'activemq.prefetchSize' => 10 > > } > > ); > > my $frame1 = $stomp->receive_frame(); > > my $frame2 = $stomp->receive_frame(); > > my $frame3 = $stomp->receive_frame(); > > > > #Ack messages out of order (specifically, ack message 2 after message 3) > > $stomp->ack({'frame' => $frame1}); > > $stomp->ack({'frame' => $frame3}); > > $stomp->ack({'frame' => $frame2}); > > > > my $error = 0; > > #Wait max of 1 second for the broker to send an error frame > > if ($stomp->can_read({'timeout' => 1})) { > > my $frame = $stomp->receive_frame(); > > if ($frame->{'command'} eq 'ERROR') { > > $error = 1; > > print "Received error: " . Dumper($frame); > > } > > } > > $stomp->disconnect; > > > > #Assert that no error was received > > ok(!$error, "Ack previous message after prior message"); > > > > On Mon, Jan 26, 2009 at 12:19 AM, Dejan Bosanac > > wrote: > > > > > It would be ideal to create a test case using simple Java API > > > > > > http://activemq.apache.org/stomp.html#Stomp-JavaAPI > > > > > > and add it to the > > > > > > > > > > > > http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?view=markup > > > > > > If Perl is easier for you, just send it and I'll translate it to the > Java > > > test case. > > > > > > Cheers > > > -- > > > Dejan Bosanac > > > > > > Open Source Integration - http://fusesource.com/ > > > ActiveMQ in Action - http://www.manning.com/snyder/ > > > Blog - http://www.nighttale.net > > > > > > > > > On Fri, Jan 23, 2009 at 7:24 PM, Roger Hoover > > >wrote: > > > > > > > Hi Dejan, > > > > > > > > Thanks for the reply. Do you need it in a particular language? I > > could > > > > easily create a test case in Perl for it. > > > > > > > > Roger > > > > > > > > On Fri, Jan 23, 2009 at 8:31 AM, Dejan Bosanac > > > > wrote: > > > > > > > > > It shouldn't behave that way. Can you create a test case to > simulate > > > this > > > > > behavior? > > > > > > > > > > Cheers > > > > > -- > > > > > Dejan Bosanac > > > > > > > > > > Open Source Integration - http://fusesource.com/ > > > > > ActiveMQ in Action - http://www.manning.com/snyder/ > > > > > Blog - http://www.nighttale.net > > > > > > > > > > > > > > > On Fri, Jan 23, 2009 at 10:18 AM, Roger Hoover < > > roger.hoover@gmail.com > > > > > >wrote: > > > > > > > > > > > I'm experiencing the same issue, both on ActiveMQ 4.1.1 and > 5.2.0. > > > > > > > > > > > > Two questions: > > > > > > 1) It seems like broker is accepting the ACK and erroneously > > replying > > > > > with > > > > > > the ERROR message. Is that correct? > > > > > > 2) Is this a bug and an intentional design to disallow STOMP > > clients > > > > from > > > > > > handle messages concurrently? > > > > > > > > > > > > Any insight is appreciated. Thanks, > > > > > > > > > > > > Roger > > > > > > > > > > > > On Mon, Oct 22, 2007 at 3:42 AM, Sebastjan Trepca < > > trepca@gmail.com> > > > > > > wrote: > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > I'm having problems with acknowledge order in ActiveMQ 4.1.1 > > using > > > > > > > STOMP protocol. I'm using a queue with async mode on. > > > > > > > > > > > > > > I'm also using these headers: > > > > > > > > > > > > > > SUBSCRIBE > > > > > > > activemq.dispatchAsync:'true' > > > > > > > activemq.noLocal:'true', > > > > > > > activemq.retroactive:'true', > > > > > > > activemq.prefetchSize:1000, > > > > > > > activemq.maximumPendingMessageLimit:1000, > > > > > > > > > > > > > > MESSAGE > > > > > > > expires:0, > > > > > > > persistent:'true', > > > > > > > priority:0, > > > > > > > > > > > > > > > > > > > > > > > > > > > > The problem occurs when I try to acknowledge messages in > > different > > > > > > > order then they were sent. > > > > > > > > > > > > > > So if producer sends messages with IDs: > > > > > > > 1 > > > > > > > 2 > > > > > > > 3 > > > > > > > > > > > > > > > > > > > > > I have to acknowledge them in the same order: > > > > > > > 1 > > > > > > > 2 > > > > > > > 3 > > > > > > > > > > > > > > Or else I get this error: > > > > > > > > > > > > > > ERROR org.apache.activemq.transport.stomp.ProtocolException: > > > > > > > Unexpected ACK received for message-id > > > > > > > [ID:localhost-47986-1193059223135-3:5:-1:1:26055] > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.transport.stomp.ProtocolConverter.onStompAck(ProtocolConverter.java:242) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommad(ProtocolConverter.java:141) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:71) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84) > > > > > > > at > > > > > > > > > > > > > > > > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:137) > > > > > > > at java.lang.Thread.run(Thread.java:619) > > > > > > > > > > > > > > Is this a feature or a bug? Do I need to set some extra > settings? > > > > > > > > > > > > > > Thanks, Sebastjan > > > > > > > > > > > > > > > > > > > > > > > > > > > > --001636e1fcb6de945004627fac77--