Reputation: 1397
I am using kafkaTemplate to send messages to kafka topic . I came across an requirement which says in case if there is a failure while sending the messages to kafka topic then I should retry sending message on same partition with same offset. Kindly help on how this can be achieved using kafkatemplate ?
Upvotes: 0
Views: 1509
Reputation: 768
You can retry the message using the standard retry mechanism and you can use the CustomPartitioners to send the message always to a specific partition, based on a Keying scheme. But offset is something, you can't predict in advance, because it is only be returned in the Record Metatdata via Java Future, only when Broker Acknowledges your message.
Better you can re-validate your requirements here.
Upvotes: 0