I hope this helps you . The pre-commit hook is intended to check the commited content and not the commit message. You are probably looking for a prepare-commit-msg hook or more likely a commit-msg hook to make your change to the commit message.
git: How to change the commit message of an already made commit non-interactively without changing the commit ID?
I hope this helps you . You cannot change a commit message without changing the commit id because the commit message is part of the data that is hashed to form the commit id. This is why all the tools which change a single commit generally change all the subsequent commits (filter-branch, rebase, etc.) because once you change one commit in a history all the descendants must change because they have a new ancestor with a new id.
How to change the name of committed commit message on Github?
Does that help If you know which partition your kafka consumer is currently accessing, you can use kafkaconsumer.seek(partition, offset) method to tell your consumer to read message from a particular offset. Example:
//to get the partition from consumer record
val partition: Int = consumerRecord.partition()
//to get offset of current record
val recordOffset = consumerRecord.offset()
if(data processing fail condition)
consumer.seek(new TopicPartition(topic, partition), recordOffset )
//will return records from recordOffset now, if data processing fail condition was true