Announcement Announcement Module
Collapse
No announcement yet.
JMS -SpringJMS- get Number of message on queque Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS -SpringJMS- get Number of message on queque

    hi everybody,
    i'm a newbie of Jms,

    i have 3 different queque in jboss mq, i need to know the number of message in each queque.
    and i need to know the number of current processing message in each queque

    it's possibile?



    i use Spring framework and SpringJmsTemplate and Jboss 4.2.3.

    Thanks !!!
    byeeee

  • #2
    1. Check QueueBrowser;
    2. Check JBoss JMS JMX facilities;

    Comment


    • #3
      QueueBrowser

      hi

      i insert this code into the onMessage method of Listener, i send many message to the queue but the count variable is alway 0.
      do you know where is the mistake?

      thanks everybody
      byeeeee

      QueueBrowser browser= session.createBrowser((Queue)message.getJMSDestina tion());
      log.info("browser :"+browser.getQueue());

      Enumeration messages = browser.getEnumeration();
      browser.close();
      int count=0;
      while (messages.hasMoreElements())
      {
      count++;
      log.info(" messages.nextElement() :"+messages.nextElement() );

      }
      log.info("Count :"+count);*/
      /*getJmsTemplate().ute(new SessionCallback() {
      @Override
      public Object doInJms(Session session) throws JMSException {
      QueueBrowser browser= session.createBrowser((Queue)message.getJMSDestina tion());
      log.info("browser "+browser);
      try {
      Enumeration en = browser.getEnumeration();
      if(!en.hasMoreElements())
      log.info("No element in queue");
      while (en.hasMoreElements()) {
      System.out.println("fjdkf" + en.nextElement());
      }
      } finally {
      browser.close();
      }
      return null;
      }

      Comment

      Working...
      X