code: public Message listen(Destination dest, String messageSelector) throws MessagingException {
          if(logger.isDebugEnabled()) {
              logger.debug("listen() - Synchronous listen on destination " + dest);
          }
          try {
              Session s =
                      connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
              MessageConsumer c = s.createConsumer(dest, messageSelector);
              Message msg = c.receive();
              s.close();
              return msg;
          } catch (JMSException e) {
              throw new MessagingException(e.getMessage(), e);
          }
      }
docs: This is a synchronous listen. The caller will block until a message is
  received for the given destination.
  Messages will be filtered based on the provided message selector.
  
  @param dest
  the Destination to listen on
  @param messageSelector
  selection criteria for filtering messages
  @return the Message received for the given Destination
  @throws MessagingException