Junior — Middle
Is it possible to re-read a message from a Kafka queue after processing?
sobes.tech AI
Answer from AI
Yes, in Kafka, it is possible to re-read a message after processing it if the offset has not been committed. In Kafka, the consumer manages offsets independently, and as long as the offset is not committed, you can receive the same messages upon restart or re-reading.
For example, if you use automatic offset acknowledgment, the offset will be committed after processing the message, and the message will not be read again. If you use manual offset management, you can choose not to commit the offset, and upon the next start, the consumer will read the message again.
Thus, re-reading is possible but depends on how you manage offsets in your Kafka consumer.