jsr343-experts@jms-spec.java.net

[jsr343-experts] (JMS_SPEC-102) Make JMSConsumer.receivePayload methods consistent with Message.getBody

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Fri, 26 Oct 2012 17:05:24 +0100

I have logged this JIRA issue:
http://java.net/jira/browse/JMS_SPEC-102
Make JMSConsumer.receivePayload methods consistent with Message.getBody

JMS_SPEC_64 introduced a new interface JMSConsumer for JMS 2.0. This has methods receivePayload(Class<T> c),
receivePayload(Class<T> c, long timeout) and receivePayloadNoWait(Class<T> c).

JMS_SPEC-101 will introduce a new method getBody(Class<T> c).

If JMS_SPEC-101 is agreed then the definition of receivePayload(Class<T> c), receivePayload(Class<T> c, long
timeout) and receivePayloadNoWait(Class<T> c) should be amended to make it consistent with the definition of
getBody(Class<T> c). Specifically, these methods should allow the specified class to be any type to which the
message payload can be assigned.

In addition, the name of these method should be changed to receiveBody(Class<T> c), receiveBody(Class<T> c, long
timeout) and receiveBodyNoWait(Class<T> c) since the word "payload" is inconsistent with the term "body" which is
used in JMS 1.1.

I will wait until JMS_SPEC-101 is resolved. Then I will make some more specific proposals for changes to receivePayload
and receivePayloadNoWait for you to review.

Nigel