Ensure that the subscriptionByConsumerId map gets cleaned up when a
sender is closed.
This commit is contained in:
Timothy Bish 2014-12-11 13:02:47 -05:00
parent d25c52ccb2
commit 9bd070a8f6
1 changed files with 3 additions and 0 deletions

View File

@ -985,11 +985,14 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
public void onClose() throws Exception {
if (!closed) {
closed = true;
sender.setContext(null);
subscriptionsByConsumerId.remove(consumerId);
AmqpSessionContext session = (AmqpSessionContext) sender.getSession().getContext();
if (session != null) {
session.consumers.remove(info.getConsumerId());
}
RemoveInfo removeCommand = new RemoveInfo(consumerId);
removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId);
sendToActiveMQ(removeCommand, null);