/** * Must hold this.consumersMonitor. * @param consumers a copy of this.consumers. */ private void actualShutDown(List<SimpleConsumer> consumers) { Assert.state(getTaskExecutor() != null, "Cannot shut down if not initialized"); this.logger.debug("Shutting down"); consumers.forEach(this::cancelConsumer); this.consumers.clear(); this.consumersByQueue.clear(); this.logger.debug("All consumers canceled"); if (this.consumerMonitorTask != null) { this.consumerMonitorTask.cancel(true); this.consumerMonitorTask = null; } }
/** * Must hold this.consumersMonitor. * @param consumers a copy of this.consumers. */ private void actualShutDown(List<SimpleConsumer> consumers) { Assert.state(getTaskExecutor() != null, "Cannot shut down if not initialized"); this.logger.debug("Shutting down"); consumers.forEach(this::cancelConsumer); this.consumers.clear(); this.consumersByQueue.clear(); this.logger.debug("All consumers canceled"); if (this.consumerMonitorTask != null) { this.consumerMonitorTask.cancel(true); this.consumerMonitorTask = null; } }
if (queueNames.length > 0) { doRedeclareElementsIfNecessary(); getTaskExecutor().execute(() -> { // NOSONAR never null here
if (queueNames.length > 0) { doRedeclareElementsIfNecessary(); getTaskExecutor().execute(() -> { // NOSONAR never null here