mirror of https://github.com/apache/activemq.git
Decrement the message reference when the messages are removed from the vm pending cursor.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@641027 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54280bcfec
commit
b02c06fb31
|
@ -41,9 +41,12 @@ public class VMPendingMessageCursor extends AbstractPendingMessageCursor {
|
||||||
@Override
|
@Override
|
||||||
public List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception {
|
public List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception {
|
||||||
List<MessageReference> rc = new ArrayList<MessageReference>();
|
List<MessageReference> rc = new ArrayList<MessageReference>();
|
||||||
for (MessageReference r : list) {
|
for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();) {
|
||||||
|
MessageReference r = iterator.next();
|
||||||
if( r.getRegionDestination()==destination ) {
|
if( r.getRegionDestination()==destination ) {
|
||||||
|
r.decrementReferenceCount();
|
||||||
rc.add(r);
|
rc.add(r);
|
||||||
|
iterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rc ;
|
return rc ;
|
||||||
|
|
Loading…
Reference in New Issue