@Override public boolean isRunning() { return (this.container != null) && this.container.isRunning(); }
@Override public boolean isRunning() { return this.listenerContainer != null && this.listenerContainer.isRunning(); }
@Override public boolean isRunning() { return (this.container != null) && this.container.isRunning(); }
@Override public boolean isRunning() { return this.listenerContainer != null && this.listenerContainer.isRunning(); }
/** * Set the name of the queue(s) to receive messages from. * @param queues the desired queue(s) (can not be <code>null</code>) */ public final void setQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.isTrue(StringUtils.hasText(queue.getName()), "Cannot add broker-named queues dynamically"); } } this.queues = new CopyOnWriteArrayList<>(queues); }
/** * Add queue(s) to this container's list of queues. * @param queues The queue(s) to add. */ public void addQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.hasText(queue.getName(), "Cannot add broker-named queues dynamically"); } } this.queues.addAll(Arrays.asList(queues)); }
/** * Add queue(s) to this container's list of queues. * @param queues The queue(s) to add. */ public void addQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.hasText(queue.getName(), "Cannot add broker-named queues dynamically"); } } this.queues.addAll(Arrays.asList(queues)); }
/** * Set the name of the queue(s) to receive messages from. * @param queues the desired queue(s) (can not be <code>null</code>) */ public final void setQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.isTrue(StringUtils.hasText(queue.getName()), "Cannot add broker-named queues dynamically"); } } this.queues = new CopyOnWriteArrayList<>(queues); }
/** * Start this container. * @see #doStart */ @Override public void start() { if (isRunning()) { return; } if (!this.initialized) { synchronized (this.lifecycleMonitor) { if (!this.initialized) { afterPropertiesSet(); } } } try { if (logger.isDebugEnabled()) { logger.debug("Starting Rabbit listener container."); } configureAdminIfNeeded(); checkMismatchedQueues(); doStart(); } catch (Exception ex) { throw convertRabbitAccessException(ex); } }
/** * Start this container. * @see #doStart */ @Override public void start() { if (isRunning()) { return; } if (!this.initialized) { synchronized (this.lifecycleMonitor) { if (!this.initialized) { afterPropertiesSet(); } } } try { if (logger.isDebugEnabled()) { logger.debug("Starting Rabbit listener container."); } configureAdminIfNeeded(); checkMismatchedQueues(); doStart(); } catch (Exception ex) { throw convertRabbitAccessException(ex); } }
if (!isRunning()) { if (logger.isWarnEnabled()) { logger.warn("Rejecting received message because the listener container has been stopped: " + messageIn);
if (!isRunning()) { if (logger.isWarnEnabled()) { logger.warn("Rejecting received message because the listener container has been stopped: " + messageIn);