super.removeConsumer(context, sub.getConsumerInfo()); } else {
@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); } }
destinationsLock.readLock().unlock(); super.removeConsumer(context, sub.getConsumerInfo()); super.addConsumer(context, info); sub = durableSubscriptions.get(key);
@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) { sub.deactivate(keepDurableSubsActive); } } else { super.removeConsumer(context, info); } }
@Override public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { SubscriptionKey key = new SubscriptionKey(info.getClientId(), info.getSubscriptionName()); DurableTopicSubscription sub = durableSubscriptions.remove(key); if (sub == null) { throw new InvalidDestinationException("No durable subscription exists for: " + info.getSubscriptionName()); } if (sub.isActive()) { throw new JMSException("Durable consumer is in use"); } synchronized (destinationsMutex) { for (Iterator<Destination> iter = destinations.values().iterator(); iter.hasNext();) { Destination dest = iter.next(); //Account for virtual destinations if (dest instanceof Topic){ Topic topic = (Topic)dest; topic.deleteSubscription(context, key); } } } if (subscriptions.get(sub.getConsumerInfo()) != null) { super.removeConsumer(context, sub.getConsumerInfo()); } else { // try destroying inactive subscriptions destroySubscription(sub); } }
@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); } }
super.removeConsumer(context, sub.getConsumerInfo()); } else {
super.removeConsumer(context, sub.getConsumerInfo()); } else {
super.removeConsumer(context, sub.getConsumerInfo()); } else {
super.removeConsumer(context, sub.getConsumerInfo()); super.addConsumer(context, info); sub = durableSubscriptions.get(key);
destinationsLock.readLock().unlock(); super.removeConsumer(context, sub.getConsumerInfo()); super.addConsumer(context, info); sub = durableSubscriptions.get(key);
destinationsLock.readLock().unlock(); super.removeConsumer(context, sub.getConsumerInfo()); super.addConsumer(context, info); sub = durableSubscriptions.get(key);
destinationsLock.readLock().unlock(); super.removeConsumer(context, sub.getConsumerInfo()); super.addConsumer(context, info); sub = durableSubscriptions.get(key);