如何在春季启动中按顺序使用kafka主题

时间:2020-06-26 15:57:15

标签: spring-boot apache-kafka spring-kafka

我有一个问题,我在春季靴子中让apache kafka使用者使用了3个不同的主题。但是我需要先使用第一个主题中的所有数据,然后再使用以下主题中的数据,有没有办法做到这一点?还是您总是以相同的方式阅读它们?

@Component
public class KafkaTestListener {

@KafkaListener(topics = "${message.topic.name}", groupId = "${message.group.name}")
    public void listenTopic1(String message) {....}

@KafkaListener(topics = "${message.topic.name2}", groupId = "${message.group.name}")
    public void listenTopic3(String message) {....}

@KafkaListener(topics = "${message.topic.name3}", groupId = "${message.group.name}")
    public void listenTopic3(String message) {.....}

}

1 个答案:

答案 0 :(得分:0)

相关问题