jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: (JMS_SPEC-68) Add new method Session.acknowledge()

From: Rüdiger zu Dohna <ruediger.dohna_at_1und1.de>
Date: Mon, 16 Jan 2012 16:48:33 +0100

+1

On 2012-01-16, at 16:44, Nigel Deakin wrote:

> I have logged the following issue:
> http://java.net/jira/browse/JMS_SPEC-68
>
> When a session is created with an acknowledgement mode of Session.CLIENT_ACKNOWLEDGE, messages are acknowledged by
> calling the acknowledge() method on the Message object.
>
> However this method is potentially misleading because calling it causes all messages delivered to the Session to be
> acknowledged,. It doesn't just acknowledge the Message on which the acknowledge method is called. JMS 1.1 recognised
> this issue and clarified the spec and javadocs to make this clear.
>
> However the fact that the acknowledge method is on the Message is still potentially confusing. Although we can never
> remove this method because of the need to maintain compatibility, adding an acknowledge method to the Session would
> allow application code to reflect the true behaviour.
>
> It is therefore proposed that a new method acknowledge() be added to the Session interface which causes all messages
> delivered to the Session to be acknowledged (i.e. identical behaviour to the existing method).
>
> For unrelated reasons, the proposed simplified API {JMS_SPEC-64) needs to provide an acknowledge method on
> MessagingContext. This is to allow the use of methods which receive a message payload directly, and hence do not return
> a Message, to use client-acknowledgement. Adding a similar method on Session would be consistent with this.
>
> Any comments?
>
> Nigel