0 Replies Latest reply on Apr 16, 2005 6:20 AM by timfox

    JMSFacade - Transacting message acknowledgements

    timfox

      Hi All

      I've been taking a look at how to implement transacted message acks in the JMS Facade.

      Currently each MessageConsumer corresponds to a "Consumer" instance which implements the Receiver interface from the messaging core.

      So when a message is received. Consumer.handle(Routable r) is called, which results in the message being delivered.

      From my understanding so far, the handle() method should return true if the responsibility for handling the message is accepted.

      In the case of a transacted session, the message may not be acknowledged until some time (possibly much) later, so it doesn't seem possible to know whether the message is acknowledged before the handle() call returns.

      There doesn't seem to be any way to tell the receiver asynchronously that a message has been acknowledged (e.g. there's nothing like Receiver.acknowledgeMessage(MessageId id) or similar), so I'm wondering how this case could be handled.

      One possibility would be for the Consumer to store the messages in it's own persistent store and then return true if they've been stored ok. Is this what is intended?

      I'm wondering if there's already a class that does something similar that can be used for this.

      My understanding of this is gained pretty much 100% by digging through the code here, so apologies if I'm missing something obvious.

      I'm definitely learning quite a lot at the moment though which is good :)

      -Tim