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