title: JMS 2.0 QueueBrowser on Wildfly does not return messages
body: <p>I have 2 simple EJB beans.
  The first one is a timer method that is called every second. In this method I add 10 random messages to a TestQueue.</p>
  
  <pre><code>@Singleton
  @Startup
  public class Timer {
  
      @Inject
      private JMSContext context;
  
      @Resource(mappedName = "java:/jms/queue/TestQueue")
      private Queue queue;
  
      @Schedule(hour = "*", minute = "*", second = "*/1", persistent = false)
      @AccessTimeout(unit = TimeUnit.DAYS, value = 1)
      public void addToQueue() {
          for(int i = 0; i&lt;30; i++)
              context.createProducer().send(queue, "msg " + (new Random().nextInt(100)));
          printQueueSize();
      }
  
      public void printQueueSize() {
          QueueBrowser qb = context.createBrowser(queue);
          Enumeration enumeration = null;
          try {
              enumeration = qb.getEnumeration();
          } catch (JMSException e) {
              e.printStackTrace();
          }
          int size = 0;
          while(enumeration.hasMoreElements()) {
              enumeration.nextElement();
              size++;
          }
  
          System.out.println("Queue size: " + size);
      }
  }
  </code></pre>
  
  <p>Second bean is a MDB consumer. I put Thread.sleep(100) to simulate long running task and make sure that there are some messages in TestQueue.</p>
  
  <pre><code>@MessageDriven(
  activationConfig = {
          @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/jms/queue/TestQueue"),
          @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
          @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1")
  }) 
  public class Consumer implements MessageListener {
  
      @Override
      public void onMessage(Message msg) {
          try {
              Thread.sleep(100);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>The problem is that console output shows:</p>
  
  <pre><code>15:06:29,006 INFO  [stdout] (EJB default - 9) Queue size: 0
  15:06:30,006 INFO  [stdout] (EJB default - 10) Queue size: 0
  15:06:31,009 INFO  [stdout] (EJB default - 1) Queue size: 0
  </code></pre>
  
  <p>etc.</p>
  
  <p>but in the wildfly admin console I can see that there are more and more messages every second:</p>
  
  <p><img src="https://i.stack.imgur.com/u9e1n.png" alt="enter image description here"></p>
  
  <p>The question is, why the QueueBrowser return empty Enumeration? Is it a bug in HornetQ implementation or there is some reason for that?</p>