In my project I have the following ThreadPoolTaskExecutor:
@Bean(name = "threadPoolExecutor")
public ThreadPoolTaskExecutor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(2);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(10);
executor.setThreadNamePrefix("consumer-");
executor.initialize();
return executor;
}
And in the application I have 3 methods annotated with @KafkaListener. When the application starts I can see on the Kafka server that only 2 listeners managed to start.
In this case I would expect an error to be reported.
By increasing the core pool size to 3 I managed to fix the issue. This is also strange because the max pool size is 10, so I think this is another problem.
In my project I have the following ThreadPoolTaskExecutor:
And in the application I have 3 methods annotated with @KafkaListener. When the application starts I can see on the Kafka server that only 2 listeners managed to start.
In this case I would expect an error to be reported.
By increasing the core pool size to 3 I managed to fix the issue. This is also strange because the max pool size is 10, so I think this is another problem.