Anyone know exactly which JMS messages will be redelivered in CLIENT_ACKNOWLEDGE mode if the client

Posted by user360612 on Stack Overflow See other posts from Stack Overflow or by user360612
Published on 2010-06-07T16:45:18Z Indexed on 2010/06/08 5:52 UTC
Read the original article Hit count: 266

Filed under:
|

The spec says "Acknowledging a consumed message automatically acknowledges the receipt of all messages that have been delivered by its session" - but what I need to know is what it means by 'delivered'.

For example, if I call consumer.receive() 6 times, and then call .acknowledge on the 3rd message - is it (a) just the first 3 messages that are ack'd, or (b) all 6?

I'm really hoping it's option a, i.e. messages after the one you called acknowledge on WILL be redelivered, otherwise it's hard to see how you could prevent message lost in the event of my receiver process crashing before I've had a chance to persist and acknowledge the messages. But the spec is worded such that it's not clear. I get the impression the authors of the JMS spec considered broker failure, but didn't spend too long thinking about how to protect against client failure :o(

Anyway, I've been able to test with SonicMQ and found that it implements (a), i.e. messages 'received' later than the message you call .ack on DO get redelivered in the event of a crash, but I'd love to know how other people read the standard, and if anyone knows how any other providers have implemented CLIENT_ACKNOWLEDGE? (i.e. what the 'de facto' standard is)

Thanks Ben

© Stack Overflow or respective owner

Related posts about java-ee

Related posts about jms