// we sent the messages directly and must explicitly ack
synchronized(deliveredMessages) {
if (c != null) {
cleanupList.put(uid, c.getParentList());
}
Prioritized cparent = (Prioritized)cleanupList.get(uid);
if (DEBUG) {
logger.log(logger.INFO, "BrokerConsumers.removeConsumer:"+uid+
", pending="+pendingMsgs+", cleanup="+cleanup+", cparent="+cparent);
}
Iterator itr = deliveredMessages.values().iterator();
while (itr.hasNext()) {
ackEntry e = (ackEntry)itr.next();
if (!e.getConsumerUID().equals(uid)) continue;
if (e.getTUID() != null) continue;
if (pendingMsgs != null && !cleanup) {
if (pendingMsgs.contains(e.getSysMessageID())) {
continue;
}
}
if (DEBUG && DEBUG_CLUSTER_MSG) {
logger.log(logger.DEBUG,
"BrokerConsumers.removeConsumer:"+uid+", remove ackEntry="+e+ ", c="+c);
}
itr.remove();
if (c != null) {
if (c.isFalconRemote()) {
e.acknowledged(false);
} else {
PacketReference ref = e.getReference();
if (ref != null) {
ref.removeInDelivery(e.getStoredConsumerUID());
destroySet.add(ref);
}
}
continue;
}
PacketReference ref = e.getReference();
if (ref != null) {
ref.removeInDelivery(e.getStoredConsumerUID());
}
openacks.add(e);
}
itr = openacks.iterator();
while (itr.hasNext()) {
ackEntry e = (ackEntry)itr.next();
if (cparent == null) {
e.acknowledged(false);
} else {
PacketReference ref = e.getReference();
if (ref != null) openmsgs.add(ref);
}
}
if (cparent != null && openmsgs.size() > 0) {
cparent.addAllOrdered(openmsgs);
}
if (cleanup || pendingMsgs == null) {
cleanupList.remove(uid);
pendingConsumerUIDs.remove(uid);
} else {