Search code examples
spring-kafkaspring-cloud-stream

Iterating through kafka topic multiple times using spring


I would like to iterate through Kafka DL topic multiple times. I could find an implementation here. Another one could be using spring cloud. Not sure whether I can iterate over again and again with these.

Which one could be better? Or is there any better approach other than the above two?

A consumer with seek option to the oldest available offset? If this is the better approach, how can we seek to the earliest? I know that the consumer-auto-offset-reset property has got relevance only when a new consumer group is created which is not practical in my case.


Solution

  • See EDIT2 in this answer for how to seek to the beginning each time the application starts.