code: public List<String> getTopTextMessages(int maxSize, String queueName)  {
          checkStarted();
          List<String> res = new ArrayList<>();
          try(Session session = consumerConnection.createSession()) {
              Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
              Enumeration messages = session.createBrowser(queue).getEnumeration();
              for(int i = 0; i < maxSize && messages.hasMoreElements(); i++) {
                  TextMessage message = (TextMessage) messages.nextElement();
                  res.add(message.getText());
              }
              return res;
          } catch (Exception e) {
              throw new AsyncException("Could not lookup messages", e);
          }
      }
docs: Returns top <code>TextMessage</code>s in queue. Does not remove anything from queue. This method can be used for
  an admin tool to peek inside the queue.
  
  @param maxSize max number of messages to lookup.
  @return top commands in queue or empty list is nothing is found in queue.