diff --git a/kafka-01/kafka-01-consumer/src/main/java/cn/skcks/study/springcloud/kafka/consumer/services/MQListener.java b/kafka-01/kafka-01-consumer/src/main/java/cn/skcks/study/springcloud/kafka/consumer/services/MQListener.java index 16e14d2..10bf17d 100644 --- a/kafka-01/kafka-01-consumer/src/main/java/cn/skcks/study/springcloud/kafka/consumer/services/MQListener.java +++ b/kafka-01/kafka-01-consumer/src/main/java/cn/skcks/study/springcloud/kafka/consumer/services/MQListener.java @@ -11,7 +11,7 @@ import org.springframework.stereotype.Component; @Component public class MQListener { - @KafkaListener(topics = {"test"},groupId = "test-group") + @KafkaListener(topics = {"test"},groupId = "test-group", concurrency = "3") public void onMessage(ConsumerRecord record, Acknowledgment ack) { log.info("消费消息: 主题 {} 分片 {} ",record.topic(),record.partition()); log.info("key {}, value {}",record.key(),record.value());