【发布时间】:2021-03-21 12:11:42
【问题描述】:
我正在使用 ReplyingKafkaTemplate.sendAndReceive() 发送和接收由关联 ID 关联的消息。 用例有很多主题,我需要手动确认(提交)消耗的消息偏移量。到目前为止一切顺利,这是通过以下方式完成的:
@KafkaListener(topics = "${kafka.topic.request-topic}")
@SendTo("int1")
public Tx30 listen(@Payload Tx30 request, Acknowledgment ack) throws InterruptedException {
...
ack.acknowledge();
但我不知道如何手动确认最后一条消息(由 sendAndReceive() 使用的消息。
任何提示如何做到这一点?
谢谢
费尔南多
【问题讨论】:
标签: spring-boot apache-kafka spring-kafka