git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@608034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-01-02 08:16:25 +00:00
parent 409902c394
commit a0b3e3211e
1 changed files with 12 additions and 10 deletions

View File

@ -301,16 +301,18 @@ public class KahaTopicReferenceStore extends KahaReferenceStore implements Topic
String containerName = getSubscriptionContainerName(subscriberKey);
subscriberContainer.remove(subscriberKey);
TopicSubContainer container = subscriberMessages.remove(subscriberKey);
for (Iterator i = container.iterator(); i.hasNext();) {
ConsumerMessageRef ref = (ConsumerMessageRef)i.next();
if (ref != null) {
TopicSubAck tsa = ackContainer.get(ref.getAckEntry());
if (tsa != null) {
if (tsa.decrementCount() <= 0) {
ackContainer.remove(ref.getAckEntry());
messageContainer.remove(tsa.getMessageEntry());
} else {
ackContainer.update(ref.getAckEntry(), tsa);
if (container != null) {
for (Iterator i = container.iterator(); i.hasNext();) {
ConsumerMessageRef ref = (ConsumerMessageRef)i.next();
if (ref != null) {
TopicSubAck tsa = ackContainer.get(ref.getAckEntry());
if (tsa != null) {
if (tsa.decrementCount() <= 0) {
ackContainer.remove(ref.getAckEntry());
messageContainer.remove(tsa.getMessageEntry());
} else {
ackContainer.update(ref.getAckEntry(), tsa);
}
}
}
}