Kafka实现监听多个topic
遇到两个不同的topic但是要相同的处理逻辑,记录下使用@KafkaListener来监听多个topic
kafka相关配置就不写了 直接写结论
java
//监听单个topic
@KafkaListener(topics = "topic",groupId = "groupId")
//监听多个topic
@KafkaListener(topics = {"topic1","topic2"},groupId = "groupId1")