Consider this event loop:
- While more messages
- msg_in = consumer.Poll()
- msg_out = transform(msg_in)
- service.Publish(msg_out)
Assume one partition and focus on line four. When this loop crashes say there were 5 messages enroute to Kafka sent in order 1,2,3,4,5. And of these Kafka only got N<=5. Rest are lost.
If there are no retries, what can we say? That Kafka got 1 or 1,2 or 1,2,3 or 1,2,3,4 or 1,2,3,4,5? Kafka does guarantee per partition ordering.
If there are retries of course ordering is lost and Kafka may get any permutation P over what it did get take m from m=0 to N. That's understandable.
I'm using a golang wrap of rdkafka from confluent, but let's just focus on rdkafka itself.