https://issues.apache.org/activemq/browse/AMQ-2891 - add some progress info messages for cursor recovery, kicks in a 50000 messages

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@992241 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-09-03 09:19:50 +00:00
parent 4641cc0ca9
commit db5ba04cd2
1 changed files with 7 additions and 0 deletions

View File

@ -276,10 +276,17 @@ public class Queue extends BaseDestination implements Task, UsageListener {
messages.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark());
if (messages.isRecoveryRequired()) {
store.recover(new MessageRecoveryListener() {
double totalMessageCount = store.getMessageCount();
int recoveredMessageCount = 0;
public boolean recoverMessage(Message message) {
// Message could have expired while it was being
// loaded..
if ((++recoveredMessageCount % 50000) == 0) {
LOG.info("cursor for " + getActiveMQDestination().getQualifiedName() + " has recovered "
+ recoveredMessageCount + " messages. " +
(int)(recoveredMessageCount*100/totalMessageCount) + "% complete");
}
if (message.isExpired()) {
if (broker.isExpired(message)) {
messageExpired(createConnectionContext(), createMessageReference(message));