mirror of https://github.com/apache/activemq.git
applied patch from Gaetan to avoid missing a message. For background see: http://www.nabble.com/Ajax-amq%3A-Lost-messages-in-MessageListenerServlet-if-more-than-maxMessages-waiting-tf3785745s2354.html#a10705883
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@540142 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6641ef3ae7
commit
b043ebef4e
|
@ -336,16 +336,18 @@ public class MessageListenerServlet extends MessageServletSupport {
|
|||
continue;
|
||||
|
||||
// Look for any available messages
|
||||
message = consumer.receiveNoWait();
|
||||
while (message != null && messages < maximumMessages) {
|
||||
while (messages < maximumMessages) {
|
||||
message = consumer.receiveNoWait();
|
||||
if (message == null) {
|
||||
break;
|
||||
}
|
||||
messages++;
|
||||
String id = (String) consumerIdMap.get(consumer);
|
||||
writer.print("<response id='");
|
||||
writer.print(id);
|
||||
writer.print("'>");
|
||||
writeMessageResponse(writer, message);
|
||||
writer.println("</response>");
|
||||
messages++;
|
||||
message = consumer.receiveNoWait();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue