title: javax.jms.MessageConsumer hangs on receive when consumer closed
body: <p>According to the javadoc, if I call receive() on a javax.jms.MessageConsumer it will block indefinitely until a message is produced or until the message consumer is closed.</p>
  
  <p>I have a thread in which a receive() is being called. As part of the thread shutdown I am calling close(), but the consumer still blocks in receive() and so the thread will not shutdown. The gist of my code is:</p>
  
  <pre><code>public String receiveMessage() {
  ...
  ...
     System.out.println("About to receive")
     TextMessage message = (TextMessage) consumer.receive();
     System.out.println("No longer receiving")
  ...
  ...
  }
  
  public void stop() {
      try {
          if (consumer != null) {
              consumer.close();
          }
      } catch (JMSException ex) {
          throw new IllegalStateException(ex);
      }
  }
  </code></pre>
  
  <p>In the debugger I can see close() being called, but the receive still blocks. If I use the receive() method with a timeout it will block until the timeout expires.</p>
  
  <p>Everything looks right to me, hopefully someone can tell me what I am doing wrong.</p>