I have a system with Kafka that looks like this (all consumers are within a single consumer group):
Producer ---[ 1 topic, 1 partition] ---> Consumer1
|--> Consumer2
...
|--> Consumern
In each consumer I poll the messages, then do an expensive computation (from 1s up to 60s). If the operation is successful, I commit the consumer.
Can it happen that before I commit, another consumer will start to process the same message? I need to guarantee that once the message is picked up, it is executed exactly once - unless the processing fails mid-way.