activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marlet <...@freenet.de>
Subject REST problem
Date Sun, 28 Oct 2007 16:03:01 GMT

Every time I want to pull out a message of a queue with a simple GET, two
messages are deleted in the queue.

I looked at org.apache.activemq.web.MessageServlet, method doMessages(..)
from the latest snapshot5

                    // send a response for each available message (up to max
                    // messages)
                    while ((maxMessages < 0 || messages < maxMessages) &&
message != null) {
                        //
System.err.println("message["+messages+"]="+message);
                        if (ajax) {
                            writer.print("<response type='object' id='");
                            writer.print(request.getParameter("id"));
                            writer.println("'>");
                        } else {
                            // only ever 1 message for non ajax!
                            setResponseHeaders(response, message);
                        }

                        writeMessageResponse(writer, message);

                        if (ajax) {
                            writer.println("</response>");
                        }

                        // look for next message
                        message = consumer.receiveNoWait();
                        messages++;
                    }

Shouldn't the message = consumer.receiveNoWait() only be executed if ajax is
true?

-- 
View this message in context: http://www.nabble.com/REST-problem-tf4707322s2354.html#a13454626
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message