What is a Kafka Offset?
Answer
An Offset is a unique, monotonically increasing integer that identifies a message's position within a partition. Offsets start at 0. Key uses: Consumer position tracking: consumers commit their current offset to know where to resume after a restart or rebalance. Message addressing: you can fetch a specific message by partition + offset. Replay: reset a consumer's offset to an earlier position to reprocess historical messages. Consumers can seek to specific offsets: seekToBeginning() for the oldest available message, seekToEnd() for new messages only, or a specific offset for replay. The __consumer_offsets internal topic stores committed offsets durably. Understanding offsets is fundamental to Kafka's delivery semantics — offset management determines whether you get at-least-once, at-most-once, or exactly-once processing.