79144170

Date: 2024-10-31 09:43:01
Score: 2
Natty:
Report link

Every time when I launch a job, it seeks 0th Offset. So, I am getting messages from beginning. Is this a bug?

Since Aug 2020, you could use partitionOffsets on the builder to tell the reader that it should start reading from the offset stored in Kafka for the consumer group ID

return new KafkaItemReaderBuilder<String, String>()
    .partitions(0)
    .consumerProperties(props)
    .name("customers-reader")
    .saveState(true)
    .topic("test-consumer")
    .partitionOffsets(new HashMap<>()) // <--- here
    .build();

see this link

Reasons:
  • Blacklisted phrase (1): this link
  • RegEx Blacklisted phrase (1): see this link
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Zaroual Mohamed