jsr368-experts@jms-spec.java.net

[jsr368-experts] JMS_SPEC-166: Define that the JMS provider should call reset on a StreamMessage passed to a CompletionListener

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 12 Jan 2015 18:34:26 +0000

On 12/01/2015 14:12, Matthew White wrote:
>
> Just occurred that we've been discussing this for BytesMessages - does the same not apply to Stream messages as well?
> They have the same read/write semantics - and if one is being clarified should the other?

Following Matthew's suggestion, I have now logged this proposal as a separate JIRA issue:
https://java.net/jira/browse/JMS_SPEC-166
(Define that the JMS provider should call reset on a StreamMessage passed to a CompletionListener)

Description
-----------

JMS_SPEC-125 proposes that when a BytesMessage is sent asynchronously, the provider must call reset on the BytesMessage
passed to the CompletionListener.

This issue proposes making the same change to StreamMessage, for exactly the same reasons. These reasons are discussed
in JMS_SPEC-125.

Proposed changes
----------------

In the javadoc for StreamMessage, insert the following new text after the sentence ending "After the first call to reset
has been made, the message body is in read-only mode.":

Inserted text:

"When a StreamMessage is sent asynchronously, the provider must call reset on the StreamMessage passed to the
CompletionListener. This means that the CompletionListener can read the message body without needing to call reset."