@Override protected void initializeContainer(DirectMessageListenerContainer instance, RabbitListenerEndpoint endpoint) { super.initializeContainer(instance, endpoint); if (this.taskScheduler != null) { instance.setTaskScheduler(this.taskScheduler); } if (this.monitorInterval != null) { instance.setMonitorInterval(this.monitorInterval); } if (endpoint != null && endpoint.getConcurrency() != null) { try { instance.setConsumersPerQueue(Integer.parseInt(endpoint.getConcurrency())); } catch (NumberFormatException e) { throw new IllegalStateException("Failed to parse concurrency: " + e.getMessage(), e); } } else if (this.consumersPerQueue != null) { instance.setConsumersPerQueue(this.consumersPerQueue); } }
@Override protected void initializeContainer(DirectMessageListenerContainer instance, RabbitListenerEndpoint endpoint) { super.initializeContainer(instance, endpoint); if (this.taskScheduler != null) { instance.setTaskScheduler(this.taskScheduler); } if (this.monitorInterval != null) { instance.setMonitorInterval(this.monitorInterval); } if (endpoint != null && endpoint.getConcurrency() != null) { try { instance.setConsumersPerQueue(Integer.parseInt(endpoint.getConcurrency())); } catch (NumberFormatException e) { throw new IllegalStateException("Failed to parse concurrency: " + e.getMessage(), e); } } else if (this.consumersPerQueue != null) { instance.setConsumersPerQueue(this.consumersPerQueue); } if (this.messagesPerAck != null) { instance.setMessagesPerAck(this.messagesPerAck); } if (this.ackTimeout != null) { instance.setAckTimeout(this.ackTimeout); } }
container.setTaskScheduler(this.taskScheduler);
container.setTaskScheduler(this.taskScheduler);