1 Reply Latest reply on Dec 9, 2014 5:33 PM by jbertram

    Queue is always empty when using @MDB

    alansmanne

      Hello,

       

      While I can successfully send and receive message from my queue, I can never use the JConsole, Web admin or any software such as HermesJMS to browse this Queue.

      If I remove the

      @MessageDriven(activationConfig =
      {
         @ActivationConfigProperty(propertyName="destinationType",propertyValue="javax.jms.Queue"),
         @ActivationConfigProperty(propertyName="destination", propertyValue="queue/msPrefetchQueue"),
         @ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false"),
      })
      
      
      
      

      from the class, I can now browse the queue and see the list of all messages.

       

      That means for now, the only way to browse my queue is to stop jboss... but then if Jboss is stopped i can't connect to the queue...

      Is there any configuration I should setup to both be able to use a MDB, AND HermesJMS (for example) to browse my queue? Do I need to allow multiple consumers (and how) ?

      Should I use a topic instead?

       

      <jms-queue name="msPrefetchQueue">
          <entry name="queue/msPrefetchQueue"/>
           <entry name="java:jboss/exported/jms/queue/msPrefetchQueue"/>
      </jms-queue>
      
      
      
      

       

      Edit : I've tried to add

      <producer-window-size>0</producer-window-size>
      
      

      To my standalone... but now I can't conenct anymore with HermesJMS...

       

      Kind regards,

        • 1. Re: Queue is always empty when using @MDB
          jbertram

          This is almost certainly caused by the MDB consumers pre-fetching messages which means there are no messages available for the browser to see.  Try setting this on your MDB:

           

          @ActivationConfigProperty(propertyName = "consumerWindowSize", propertyValue = "0")
          

           

          Note, however, that consumer pre-fetching is a performance optimization and disabling it may negatively impact performance.  See the documentation for more details.