【发布时间】:2022-01-02 16:47:13
【问题描述】:
spring kafka 中的 setConsumerTaskExecutor() 和 setConcurrency() 有什么区别? 如果 ConsumerTaskExecutor 的 maxpool 大小与 setConcurrency 值不同会发生什么?
ThreadPoolTaskExecutor customExecutor= new ThreadPoolTaskExecutor();
exec.setCorePoolSize(3);
exec.setMaxPoolSize(6);
ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory<String, String>();
factory.setConcurrency(10);
factory.getContainerProperties().setConsumerTaskExecutor(customExecutor);
谢谢
【问题讨论】:
标签: spring-boot apache-kafka spring-kafka