Topic
  • 1 reply
  • Latest Post - ‏2013-02-15T10:43:26Z by SystemAdmin
SystemAdmin
SystemAdmin
4447 Posts

Pinned topic JMS

‏2003-01-13T18:31:23Z |
I am using PTP for messaging. I want to write an application which runs as a
batch, It runs once in a day and tries to get messages from a queue and
processes those messages. I runs the next day and takes the new messages. Are
are any methods in JMS to get the number of messages in the queue and also i
want to just get the messages and close the connection.

Thanks in advance
padma
Updated on 2013-02-15T10:43:26Z at 2013-02-15T10:43:26Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    4447 Posts

    Re: JMS

    ‏2013-02-15T10:43:26Z  
    You can use QueryBrowser.

    Enumeration e = queueBrowser.getEnumeration();
    // count number of messages
    while (e.hasMoreElements()) {
    Message message = (Message) e.nextElement();
    numMsgs++;
    logger.info("Message Count in Queue:"+numMsgs);
    logger.info("Message: " + message);
    }

    search it out or if this still not work you can mail me arpan_mehta286@yahoo.com, I have other technique to achieve this as well.

    Regards,
    Arpan