Reputation: 505
I would like to know is there any way I can only seek 1 message from the old offset? Since I only want to reprocess 1 message.
Upvotes: 1
Views: 119
Reputation: 121550
You should implement ConsumerSeekAware
and in its:
/**
* When using group management, called when partition assignments change.
* @param assignments the new assignments and their current offsets.
* @param callback the callback to perform an initial seek after assignment.
*/
void onPartitionsAssigned(Map<TopicPartition, Long> assignments, ConsumerSeekCallback callback);
perform desired -1
on the required partition
with its offset
as a value from that assignments
map.
Upvotes: 2