3 Replies Latest reply on May 15, 2009 10:18 AM by Stan Lewis

    Message not removed from ActiveMQ queue

    Ankit Vernekar Newbie

      Hi folks,

                 I have a servicemix file poller running.It has a JMS file component that puts a xml file on the activemq queue.I implemented a listener to receive this xml from the queue.The listener retrieves the xml successfully but the message does not get deleted from the queue once the xml is read.The implementation for listener is as follows


      public void start()


                System.out.println("Inside start.");



                conFac=new ActiveMQConnectionFactory();


                session=con.createSession(false, Session.AUTO_ACKNOWLEDGE);


                Destination destination = new ActiveMQQueue("PaymentsXML");          



                System.out.println("start ended");          


                catch(Exception e)






      public void onMessage(Message msg)


                System.out.println("On Message on");

                try {

                     TextMessage tmsg=(TextMessage)msg;

                     String output=tmsg.getText();

                     Transformer t=new Transformer();

                     String result=t.XMLtoXML(output);




                     PrintWriter pr=new PrintWriter("C:
      Documents and Settings




                } catch (Exception e) {





      onMessage methods reads the message from the queue.By default the message should get deleted from the queue once read.

      Am I going wrong somewhere? if so please help

      Versions used

      ActiveMQ 5.2.0

      JDK 1.6

      Windows XP



      Ankit Vernekar