mirror of https://github.com/apache/activemq.git
reset redivery counter on retryMessage() - and speed it up a little -
for https://issues.apache.org/activemq/browse/AMQ-1909 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@691214 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d14e4aee1c
commit
e8a74514da
|
@ -100,10 +100,12 @@ public class QueueView extends DestinationView implements QueueViewMBean {
|
|||
Queue queue = (Queue) destination;
|
||||
Message rc = queue.getMessage(messageId);
|
||||
if (rc != null) {
|
||||
rc = rc.copy();
|
||||
rc.getMessage().setRedeliveryCounter(0);
|
||||
ActiveMQDestination originalDestination = rc.getOriginalDestination();
|
||||
if (originalDestination != null) {
|
||||
ConnectionContext context = BrokerView.getConnectionContext(broker.getContextBroker());
|
||||
return queue.moveMessageTo(context, messageId, originalDestination);
|
||||
return queue.moveMessageTo(context, rc, originalDestination);
|
||||
}
|
||||
else {
|
||||
throw new JMSException("No original destination for message: "+ messageId);
|
||||
|
|
|
@ -850,6 +850,20 @@ public class Queue extends BaseDestination implements Task {
|
|||
} while (count < this.destinationStatistics.getMessages().getCount());
|
||||
return movedCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move a message
|
||||
* @param context
|
||||
* @param r
|
||||
* @param dest
|
||||
* @throws Exception
|
||||
*/
|
||||
public boolean moveMessageTo(ConnectionContext context,Message m,ActiveMQDestination dest) throws Exception {
|
||||
QueueMessageReference r = createMessageReference(m);
|
||||
BrokerSupport.resend(context, m, dest);
|
||||
removeMessage(context, r);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the message matching the given messageId
|
||||
|
|
Loading…
Reference in New Issue