Mantis - Resin
Viewing Issue Advanced Details
150 minor always 05-09-05 00:00 11-30-05 14:44
ferg  
 
urgent  
closed 3.0.13  
3.0.13 fixed  
none    
none 3.0.14  
0000150: JMS queue browser
RSN-144
(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.

Regards,

Tom


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

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


Notes
(0000182)
ferg   
05-09-05 00:00   
ejb/6270, ejb/6271