https://issues.apache.org/jira/browse/AMQ-4276 - remove sub from conduit lis immediatly or weget duplicate remove avents as shown by org.apache.activemq.usecases.TwoBrokerQueueSendReceiveTest

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1439870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2013-01-29 12:50:15 +00:00
parent ef24cc9a04
commit bf787569d2
1 changed files with 4 additions and 3 deletions

View File

@ -804,6 +804,10 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
+ " for remote " + sub.getRemoteInfo().getConsumerId());
}
// ensure not available for conduit subs pending removal
subscriptionMapByLocalId.remove(sub.getLocalInfo().getConsumerId());
subscriptionMapByRemoteId.remove(sub.getRemoteInfo().getConsumerId());
// continue removal in separate thread to free up this thread for outstanding responses
// serialise with removeDestination operations so that removeSubs are serialised with removeDestinations
// such that all removeSub advisories are generated
@ -815,9 +819,6 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
localBroker.oneway(sub.getLocalInfo().createRemoveCommand());
} catch (IOException e) {
LOG.warn("failed to deliver remove command for local subscription, for remote " + sub.getRemoteInfo().getConsumerId(), e);
} finally {
subscriptionMapByLocalId.remove(sub.getLocalInfo().getConsumerId());
subscriptionMapByRemoteId.remove(sub.getRemoteInfo().getConsumerId());
}
}
});