@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug(broker.getBrokerName() + " removing consumer: " + info.getConsumerId() + " for destination: " + info.getDestination()); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); synchronized (destinationsMutex) { for (Iterator iter = destinationMap.get(info.getDestination()).iterator(); iter.hasNext();) { Destination dest = (Destination) iter.next(); removeList.add(dest); } } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }