jms-spec
  1. jms-spec
  2. JMS_SPEC-102

Make JMSConsumer.receivePayload methods consistent with Message.getBody

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0PD
    • Fix Version/s: 2.0PD, 2.0
    • Labels:
      None

      Description

      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, these methods should throw a MessageFormatException rather than a ClassCastException if the message payload cannot 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.

        Issue Links

          Activity

          Nigel Deakin created issue -
          Nigel Deakin made changes -
          Field Original Value New Value
          Link This issue depends on JMS_SPEC-101 [ JMS_SPEC-101 ]
          Nigel Deakin made changes -
          Assignee Nigel Deakin [ nigeldeakin ]
          Nigel Deakin made changes -
          Tags pd20-forreview-minor
          Hide
          Nigel Deakin added a comment -

          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().

          Show
          Nigel Deakin added a comment - 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() .
          Nigel Deakin made changes -
          Link This issue blocks MQ-228 [ MQ-228 ]
          Nigel Deakin made changes -
          Description 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.
          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, these methods should throw a MessageFormatException rather than a ClassCastException if the message payload cannot 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.
          Hide
          Nigel Deakin added a comment -

          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.

          Show
          Nigel Deakin added a comment - 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.
          Hide
          nwright added a comment -

          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.

          Show
          nwright added a comment - 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.
          Hide
          Nigel Deakin added a comment -

          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.

          Show
          Nigel Deakin added a comment - 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.
          Nigel Deakin made changes -
          Tags pd20-forreview-minor pd20-added pd20-forreview-minor
          Nigel Deakin made changes -
          Tags pd20-added pd20-forreview-minor pd20-forreview-minor
          Nigel Deakin made changes -
          Tags pd20-forreview-minor
          Nigel Deakin made changes -
          Tags pd20-added
          Nigel Deakin made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 2.0PD [ 16049 ]
          Resolution Fixed [ 1 ]
          Nigel Deakin made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Nigel Deakin made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Fix Version/s 2.0 [ 14692 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Nigel Deakin
              Reporter:
              Nigel Deakin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: