1 Reply Latest reply on Jul 23, 2014 8:55 AM by himadas

    Message is not removed from HornetQ

    himadas

      Hi,

       

      Am first time using Jboss 7.2 and am trying to deploy a simple MDB . The MDB is annotated for auto acknowledgment

       

      @MessageDriven(activationConfig = {
           @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
           @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
           @ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/test")
           
           })
      @TransactionManagement(value= TransactionManagementType.CONTAINER)
      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
      

       

      onMessage is simple , just sleep and awake. My expectation is as soon as message is consumed by MDB , it should be removed from Queue. But the message remains in the queue until onMessage is completed and the status shows as "In delivery".

       

       

       public void onMessage(Message message) {
              System.out.println("sleeping for some time");
              try {
        Thread.sleep(10*60000);
        } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        }
              System.out.println("awake and done now");
          }
      

      When the message is completed , the log shows acknowledgment is sent. Some stupid silly configuration somewhere as it is quite simple to do. .. but any idea what is missing. How to set autoacknowledgment in JBOSS 7.2 MDB

       

      15:59:33,584 INFO  [stdout] (Thread-3 (HornetQ-client-global-threads-467768789)) awake and done now

       

       

      15:59:33,586 DEBUG [org.hornetq.core.client] (Thread-3 (HornetQ-client-global-threads-467768789)) client ack messageID = 1079

        • 1. Re: Message is not removed from HornetQ
          himadas

          Anyone ? This is something simple straight forward but its not working as expected. We tried with a consumer ( a standalone java test client to read message from queue) and its working there.

           

          As soon as message is consumed by consumer its deleted from queue even though message is in processing by consumer.

           

          Any idea ?