@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }