logger error:
Consumer failed to start in 60000 milliseconds; does the task executor have enough threads to support the container concurrency?
How can I resolve it?
Thanks a lot.
I attempt to change my config like this:
@Configurationpublic class RabbitMQConfig {
private final SimpleRabbitListenerContainerFactory simpleRabbitListenerContainerFactory;private final RabbitTemplate mqTemplate;@Autowiredpublic RabbitMQConfig(SimpleRabbitListenerContainerFactory simpleRabbitListenerContainerFactory, RabbitTemplate mqTemplate) { this.simpleRabbitListenerContainerFactory = simpleRabbitListenerContainerFactory; this.mqTemplate = mqTemplate;}@PostConstructpublic void init() { simpleRabbitListenerContainerFactory.setMessageConverter(new Jackson2JsonMessageConverter()); simpleRabbitListenerContainerFactory.setTaskExecutor(Executors.newCachedThreadPool()); simpleRabbitListenerContainerFactory.setContainerConfigurer(c -> { c.setAutoDeclare(false); c.setConsumerStartTimeout(100000L); }); mqTemplate.setMessageConverter(new Jackson2JsonMessageConverter());}@Beanpublic Queue dlQueue() { return new Queue(RabbitMQConstant.DEAD_LETTER_Q, true, false, false);}@Beanpublic TopicExchange dlExchange() { return new TopicExchange(RabbitMQConstant.DEAD_LETTER_EXCHANGE, true, false);}@Beanpublic Binding dlxBinding() { return BindingBuilder.bind(dlQueue()).to(dlExchange()).with(RabbitMQConstant.ROUTE_KEY);}
}
bug the log also exist and the spring boot start slow.
2020-02-14 12:29:14.861 [main] ERROR org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer [,,,,] hia-api - Consumer failed to start in 100000 milliseconds; does the task executor have enough threads to support the container concurrency?2020-02-14 12:30:54.870 [main] ERROR org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer [,,,,] hia-api - Consumer failed to start in 100000 milliseconds; does the task executor have enough threads to support the container concurrency?2020-02-14 12:32:34.872 [main] ERROR org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer [,,,,] hia-api - Consumer failed to start in 100000 milliseconds; does the task executor have enough threads to support the container concurrency?2020-02-14 12:34:14.873 [main] ERROR org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer [,,,,] hia-api - Consumer failed to start in 100000 milliseconds; does the task executor have enough threads to support the container concurrency?2020-02-14 12:35:54.877 [main] ERROR org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer [,,,,] hia-api - Consumer failed to start in 100000 milliseconds; does the task executor have enough threads to support the container concurrency?