Details
Description
MessageServlet inside activemq-web will pull maxMessages+1 messages off of the queue but only write a response containing maxMessages.
After some debugging, I figured out that the problem is with the while loop that reads messages inside the doMessages method (and doMessagesWithoutContinuation). It always reads a message at the end of the loop, without first checking to see if maxMessages has already been reached.
Attached is a patch that corrects this issue.