@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 public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (info.isDurable()) { SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); DurableTopicSubscription sub = durableSubscriptions.get(key); if (sub != null) { // deactivate only if given context is same // as what is in the sub. otherwise, during linksteal // sub will get new context, but will be removed here if (sub.getContext() == context) { sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId()); } } } else { super.removeConsumer(context, info); } }
remove.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } catch (Exception ex) { LOG.error("Error unsubscribing " + sub + " from " + remove + ": " + ex.getMessage(), ex);
sub.info = info; sub.context = context; sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId());
@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()); } }
@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 public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (info.isDurable()) { SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); DurableTopicSubscription sub = durableSubscriptions.get(key); if (sub != null) { // deactivate only if given context is same // as what is in the sub. otherwise, during linksteal // sub will get new context, but will be removed here if (sub.getContext() == context) { sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId()); } } } else { super.removeConsumer(context, info); } }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (info.isDurable()) { SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); DurableTopicSubscription sub = durableSubscriptions.get(key); if (sub != null) { // deactivate only if given context is same // as what is in the sub. otherwise, during linksteal // sub will get new context, but will be removed here if (sub.getContext() == context) { sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId()); } } } else { super.removeConsumer(context, info); } }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (info.isDurable()) { SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); DurableTopicSubscription sub = durableSubscriptions.get(key); if (sub != null) { // deactivate only if given context is same // as what is in the sub. otherwise, during linksteal // sub will get new context, but will be removed here if (sub.getContext() == context) { sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId()); } } } else { super.removeConsumer(context, info); } }
remove.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } catch (Exception ex) { LOG.error("Error unsubscribing " + sub + " from " + remove + ": " + ex.getMessage(), ex);
remove.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } catch (Exception ex) { LOG.error("Error unsubscribing " + sub + " from " + remove + ": " + ex.getMessage(), ex);
remove.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } catch (Exception ex) { LOG.error("Error unsubscribing " + sub + " from " + remove + ": " + ex.getMessage(), ex);
public boolean updateDeliveryCountAfterCancel(MessageReference ref) { long lastDelSeqId = info.getLastDeliveredSequenceId(); //in activemq5, closing a durable subscription won't close the consumer //at broker. Messages will be treated as if being redelivered to //the same consumer. if (this.info.isDurable() && this.getOpenwireDestination().isTopic()) { return true; } //because delivering count is always one greater than redelivery count //we adjust it down before further calculating. ref.decrementDeliveryCount(); // This is a specific rule of the protocol if (lastDelSeqId == RemoveInfo.LAST_DELIVERED_UNKNOWN) { // this takes care of un-acked messages in non-tx deliveries // tx cases are handled by // org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection.CommandProcessor.processRollbackTransaction() ref.incrementDeliveryCount(); } else if (lastDelSeqId == RemoveInfo.LAST_DELIVERED_UNSET && !isRolledBack(ref)) { ref.incrementDeliveryCount(); } return true; }
sub.info = info; sub.context = context; sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId());
sub.info = info; sub.context = context; sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId());
sub.info = info; sub.context = context; sub.deactivate(keepDurableSubsActive, info.getLastDeliveredSequenceId());