If you're using Spring Kafka containers (e.g. @KafkaListener as a basis for your stuff in Spring Boot) - you don't need manual acknowledgement.
Just set AckMode in your Container Properties to RECORD - and be happy.
Container would do that lower-level Kafka API Consumer manual ack for you.
P.S. On a side note - the default 5 sec is way, way, WAY too long in a nowadays nanosecond-fine world. For one, the default for "native" Kafka API is 100ms, to my recollection.
I don't even know what these Spring Kafka guys were thinking when they set it (although it goes along with a messy quality of the package itself).