10 Replies Latest reply on Nov 6, 2014 7:10 AM by Arul Mozhi

    How to get delivering messages through jmx - HornetQ

    Arul Mozhi Newbie

      Hi All,

       

      I'm using Jboss 6 with Hornet 2.2.5.Final (HQ_2_2_5_FINAL_AS7, 121).Below code snippet shows how to get list of messages to be consumed by using jmx. In the same way i need to get list of delivering  messages through jmx.Kindly provide a solution to get this done.Attached the complete code of below snippet.

       

                     msg = queueControl.listMessages(null);

       

                      System.out.println("[HornetQ] Queue Name : " + hq.getQueueName() + " : Message Length : " + msg.length);

                      for (int lst = 0; lst < msg.length; lst++) {

                          System.out.println("lst = " + msg[lst]);

                          qvo = new QueueMgntVo();

                          qvo.MessageID = Long.parseLong(msg[lst].get("messageID").toString());

                          qvo.JMSTime = new Date(Long.parseLong(msg[lst].get("JMSTimestamp").toString()));

                          qvo.JMSPriority = Integer.parseInt(msg[lst].get("JMSPriority").toString());

                          qvo.JMSDestination = msg[lst].get("address").toString();

                          qvo.JMSDeliveryMode = msg[lst].get("JMSDeliveryMode").toString();

                          qvo.JMSExpiration = Integer.parseInt(msg[lst].get("JMSExpiration").toString());

                          qvo.JMSMessageID = msg[lst].get("JMSMessageID").toString();

                          qvo.LRPID = msg[lst].get("LRPID").toString();

                          list.add(qvo);

                          qMapData.put(hq.getQueueName(), list);

                      }

       

       

      Regards

      Arul