regression in test from https://issues.apache.org/jira/browse/AMQ-2413 required some investigation. Symptom was missing messages, turned out to be in the middle of the sequence. Issue with the priority kahadb cursors and setbatch. Set batch is invoked when the cursor memory is exhausted such that replay from the store can start at the correct point. If a call to setBatch was followed by a call to recover when there was still no memory space available, the cursor could skip the next pending message.