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

          No work has yet been logged on this issue.

            People

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

              Dates

              • Created:
                Updated: