Kafka Consumer I want it to poll the msg until consumer tell it to go to the next offset

Viewed 24

I am building an event driven software in java to listen to a Kafka Topic and sent the messages to a other server from my application. I want the Kafka consumer to keep polling the same message if my application wasn't able to sent the data successfully to the second server. to do this I had set manual commit offset and only incremented the offset when the message was sent successfully to the second server but the broker will only resend the message if my application(consumer) restarts. its a issue since I don't want my application to restart. Let me know if you have any solutions to this issue.

1 Answers

You would need to track and manually seek the consumer to the last un-processed offset(s) for each topic partition. You may also want to pause() the consumer and halt any poll loop until each record is processed

Related