Mantis - Resin
Viewing Issue Advanced Details
150 minor always 05-09-05 00:00 11-30-05 14:44
closed 3.0.13  
3.0.13 fixed  
none 3.0.14  
0000150: JMS queue browser
(rep by Thomas Gennaro)

Are there any known problems with the javax.jms.QueueBrowser implementation in Resin 3.0.9? We have the code below in one of our servlets and the Queue count always shows 0 or 1 when we know that the # of items in the queue is well above that number because we are putting more items on the queue than are being removed with a MDB.

We are trying to add logic to a servlet so that it stops handling requests when the queue grows too large in order to prevent the server from running out of memory.

We are using MemoryQueue instead of JDBC right now b/c we haven't been able to get the JMS JDBC queueing to work with Oracle.

Any suggestions are greatly appreciated.



QueueBrowser queueBrowser = queueSession.createBrowser(queue); // throws JMSException
            Enumeration enum = queueBrowser.getEnumeration();
            int i = 0;

            while (enum.hasMoreElements()) {
                logger.debug("Queue Count: " + i);
            if (i <= 20) {
                // Moved to a point after the queuing of the message
                logger.debug("Queue at : " + i + " , which is under the limit: " +
                jmsObjectMessage = queueSession.createObjectMessage(req);
                retVal = buildResponseMessage(tanum, timestamp, errorList);
            } else {
      "Queue is at: " + i + " and the queueLimit is set to " + 20);
      "Not sending an immediate response");

05-09-05 00:00   
ejb/6270, ejb/6271