In the mental model I am building of how Kafka works (new to this), the
broker keeps offsets by consumer group, and individual consumers basically
depend on the offset of the consumer group they join. Also consumer groups
may opt to start from the beginning.

OK, in that mental model there is a linearization of messages per
partition. As the documentation says, there is a total order per partition,
and the order is based on the offset, unrelated to the timestamp.

But I see the Java library has timestamp-oriented methods like:


https://kafka.apache.org/0102/javadoc/org/apache/kafka/clients/consumer/Consumer.html#offsetsForTimes(java.util.Map)

How does that make sense given the model described above? How is that
implemented? Does the broker has builtin support for this? What happens if
due to race conditions or machines with clocks out of sync you have
messages with timestamps interleaved?

Could anyone concile that API with the intrinsec offset-based contract?

Reply via email to