jms-spec
  1. jms-spec
  2. JMS_SPEC-85

Clarify how Message.receiveNoWait() is expected to behave

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1, 2.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      The javadoc for the java.jms.MessageConsumer method receiveNoWait() states that this method "Receives the next message if one is immediately available."

      Several, if not most, JMS providers interpret the meaning of "immediately" (and "no wait") literally and only return a message is one is already available on the client. They do not attempt to contact the server to fetch a message from the server, even if there is one available.

      This means that the effect of calling receiveNoWait() is unpredictable and experience suggests that developers are best advised never to use it.

      It is proposed that the behaviour of this method should be clarified to state what it says above, and to recommend the use of the other receive methods in most cases.

      Edit Following comments, this issue has been broadened to consider all possible interpretations of this method. See below

        Issue Links

          Activity

          Nigel Deakin created issue -
          Nigel Deakin made changes -
          Field Original Value New Value
          Tags pd20-forreview
          Nigel Deakin made changes -
          Affects Version/s 1.1 [ 14685 ]
          Nigel Deakin made changes -
          Tags pd20-forreview pd20-forreview pd20-minor
          Nigel Deakin made changes -
          Tags pd20-forreview pd20-minor pd20-minor
          Nigel Deakin made changes -
          Tags pd20-minor pd20-minor pd20-veryminor
          Nigel Deakin made changes -
          Tags pd20-minor pd20-veryminor pd20-veryminor
          David Zhao made changes -
          Link This issue blocks GLASSFISH-7279 [ GLASSFISH-7279 ]
          Nigel Deakin made changes -
          Tags pd20-veryminor jms21-forreview-minor pd20-veryminor
          Nigel Deakin made changes -
          Tags jms21-forreview-minor pd20-veryminor jms21-forreview-minor
          Nigel Deakin made changes -
          Affects Version/s 2.0 [ 14692 ]
          Description The javadoc for the {{java.jms.MessageConsumer}} method {{receiveNoWait()}} states that this method "Receives the next message if one is immediately available."

          Several, if not most, JMS providers interpret the meaning of "immediately" literally and only return a message is one is already available on the client. They do not attempt to contact the server to fetch a message from the server, even if there is one available.

          This means that the effect of calling {{receiveNoWait()}} is unpredictable and experience suggests that developers are best advised never to use it.

          It is proposed that the behaviour of this method should be clarified to state what it says above, and to recommend the use of the other receive methods in most cases.
          The javadoc for the {{java.jms.MessageConsumer}} method {{receiveNoWait()}} states that this method "Receives the next message if one is immediately available."

          Several, if not most, JMS providers interpret the meaning of "immediately" (and "no wait") literally and only return a message is one is already available on the client. They do not attempt to contact the server to fetch a message from the server, even if there is one available.

          This means that the effect of calling {{receiveNoWait()}} is unpredictable and experience suggests that developers are best advised never to use it.

          It is proposed that the behaviour of this method should be clarified to state what it says above, and to recommend the use of the other receive methods in most cases.
          Nigel Deakin made changes -
          Description The javadoc for the {{java.jms.MessageConsumer}} method {{receiveNoWait()}} states that this method "Receives the next message if one is immediately available."

          Several, if not most, JMS providers interpret the meaning of "immediately" (and "no wait") literally and only return a message is one is already available on the client. They do not attempt to contact the server to fetch a message from the server, even if there is one available.

          This means that the effect of calling {{receiveNoWait()}} is unpredictable and experience suggests that developers are best advised never to use it.

          It is proposed that the behaviour of this method should be clarified to state what it says above, and to recommend the use of the other receive methods in most cases.
          The javadoc for the {{java.jms.MessageConsumer}} method {{receiveNoWait()}} states that this method "Receives the next message if one is immediately available."

          Several, if not most, JMS providers interpret the meaning of "immediately" (and "no wait") literally and only return a message is one is already available on the client. They do not attempt to contact the server to fetch a message from the server, even if there is one available.

          This means that the effect of calling {{receiveNoWait()}} is unpredictable and experience suggests that developers are best advised never to use it.

          It is proposed that the behaviour of this method should be clarified to state what it says above, and to recommend the use of the other receive methods in most cases.

          _Edit_ Following comments, this issue has been broadened to consider all possible interpretations of this method. See [below|#action_366528]

            People

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

              Dates

              • Created:
                Updated: