[JMS_SPEC-102] Make JMSConsumer.receivePayload methods consistent with Message.getBody Created: 26/Oct/12 Updated: 20/Mar/13 Resolved: 20/Mar/13
|Fix Version/s:||2.0PD, 2.0|
|Reporter:||Nigel Deakin||Assignee:||Nigel Deakin|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
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).
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.
|Comment by Nigel Deakin [ 26/Oct/12 ]|
In addition, all references to "payload" which were introduced in the JMS 2.0 spec should be changed to "body". (The JMS 1.1 spec does not use the word "payload", but uses the word "body" consistently, including in the names of methods such as clearBody().
|Comment by Nigel Deakin [ 30/Oct/12 ]|
Please also consider whether to simply change the names of these methods to just "receive", since there would be no clash with the existing receive methods.
|Comment by nwright [ 12/Nov/12 ]|
I like JMSConsumer.receiveBodyX(Class<T> c).
RE changing these methods to just "receive": I do not think we should move to JMSConsumer.receiveX(Class<T> c) as this is potentially confusing - it looks to me as if the whole message including headers would be delivered with this method. Better to keep the 'Body' in the method name.
|Comment by Nigel Deakin [ 16/Nov/12 ]|
The API and specification have now been updated with these changes. The new method names are receiveBody(Class<T> c), receiveBody(Class<T> c, long timeout) and receiveBodyNoWait(Class<T> c). Please see the JMS 2.0 API docs for details.