【问题标题】:Kafka Consumer -- Batch proccess and commitKafka Consumer -- Batch proccess and commit
【发布时间】:2022-12-28 01:19:31
【问题描述】:

Assume that, I have a batch (10 records) from 1 consumer.poll()

I iterate through 10 records. If the process is successful I will call commit(record.offset() + 1). So If the records have I only commit records number 4, 7, 9.

I know that when we commit records number 9 ==> The next records we can poll will be records number 10

What will happen to other records number 1,2,3,5,6,8. Do Kafka have a dead letter queue for them to go into ?

【问题讨论】:

    标签: apache-kafka kafka-consumer-api


    【解决方案1】:

    No, it doesn't. Consumers in Kafka can only consume the last offset.

    But you could have a trick and store failed messages in a database or another Kafka topic and process them later.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-28
      • 1970-01-01
      • 2023-01-13
      • 2023-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多