• 1 reply
  • Latest Post - ‏2013-02-15T10:43:26Z by 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
Updated on 2013-02-15T10:43:26Z at 2013-02-15T10:43:26Z by SystemAdmin
  • SystemAdmin
    4447 Posts

    Re: JMS

    You can use QueryBrowser.

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

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