activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonm <...@workingtoday.org>
Subject Re: STOMP broker - order of ACKs?
Date Mon, 02 Apr 2007 21:19:34 GMT

Just a clarification in the sequence that doesn't work:

- Message 1 rcvd
- ACK msg 1
- Message 2 rcvd
- Message 3 rcvd
- ACK msg 3
- ACK msg 2

the ACK of messages 1 and 3 are OK... it is the ACK of msg 2 that throws the
exception........

jon




jonm wrote:
> 
> I am new to JMS and ActiveMQ -- I have been investigating using the STOMP
> broker and things have worked well so far, but I have a question about
> ACKs to messages received by a consumer:
> 
> It seems that the order of ACKs is not important (if they are done in a
> 'batch'), for example, I can receive, say 10 messages, process them and
> then ACK all of them. I can even scramble the order of ACKs after the
> messages have been processed and it's OK.
> 
> However, say I write a forked script that processes messages as needed
> (some children take longer depending on the action required by the
> message) and the children do their own ACKing... Seems like this is not
> allowed and that this sequence of events cannot happen on the connection:
> 
> - Message 1 rcvd
> - ACK msg 1
> - Message 2 rcvd
> - Message 3 rcvd
> - ACK msg 3
> - ACK msg 2
> 
> I seem to get the following error (a STOMP ERROR frame) in this scenario:
> 
> [message] => Unexpected ACK received for message-id
> [ID:jstation-36270-1175286660410-3:148:-1:1:41]
> [body]=>
> org.apache.activemq.transport.stomp.ProtocolException: Unexpected ACK
> received for message-id [ID:jstation-36270-1175286660410-3:148:-1:1:41]
> 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:64)
> 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:534)
> 
> Although this error is thrown, the message is no longer in the queue
> (jconsole indicates no messages are waiting to be picked up/sent to the
> consumer)...... so though the exception is thrown, everything seems OK....
> is this expected? can I ignore this exception and still rely on this
> message/ack sequence?
> 
> I'm using activeMQ version 4.1.0
> 
> thanks,
> jon 
> 

-- 
View this message in context: http://www.nabble.com/STOMP-broker---order-of-ACKs--tf3508100s2354.html#a9799197
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message