activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Mayrbaeurl <juergen.mayrbae...@hvb.sozvers.at>
Subject Re: Strict order of messages with redelivery
Date Fri, 07 Sep 2007 08:31:09 GMT

Unfortunately the ordering doesn't work with client acknowledge in 4.1.0 as
the following example shows

1) 10 messages for topic produced
2) First attempt to receive the messages with a durable topic subscriber
(acknowledment mode set to client acknowlede but not called for any of the
messages)

Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:1
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:2
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:3
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:4
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:5
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:6
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:7
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:8
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:9
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:10

3) Second attempt

Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:10
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:9
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:8
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:7
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:6
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:5
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:4
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:3
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:2
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:1

4) Third attempt:

Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:1
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:2
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:3
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:4
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:5
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:6
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:7
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:8
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:9
Message ID: ID:hvb0396-1306-1189153233546-1:0:1:1:10

As you can see the order gets reversed after each attempt. I'll do some
further testing with tranacted sessions.

Kind regards
Juergen


James.Strachan wrote:
> 
> On 9/6/07, Juergen Mayrbaeurl <juergen.mayrbaeurl@hvb.sozvers.at> wrote:
>>
>> Hi!
>>
>> Our application has to make sure that all consumers with durable topic
>> subscriptions get messages in strict order even when a message has to be
>> delivered.
>> E.g.
>> Publisher puts message 1 to 10 on topic. Consumer opens a session, gets
>> message 1, makes a client acknowledment, gets message 2, makes a client
>> acknowledment, and so on. On message 3 a runtime exception occurs and no
>> client acknowledment is done, but the session and the connection are
>> closed.
>> The next time the consumer opens a session message 4 gets delivered
>> before
>> message 3.
>>
>> What do we have to do to get message 3 (and not 4) as the first message?
>> Do
>> we have to use a special redelivery policy?
> 
> It should just work; though FWIW I'd recommend you switch from using
> acknowledge to using JMS transactions. They are typically faster as
> well as allowing you to do a rollback (rather than having to close the
> session & connection on failure)
> http://activemq.apache.org/should-i-use-transactions.html
> 
> 
>> PS: We're using ActiveMQ 4.1.0
> 
> I'd also recommend you upgrade to 4.1.1
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Strict-order-of-messages-with-redelivery-tf4391491s2354.html#a12538047
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message