ਇੱਕ offset ਇੱਕ partition ਦੇ ਅੰਦਰ ਹਰੇਕ event ਲਈ ਇੱਕ ਵਿਲੱਖਣ, ਕ੍ਰਮਾਂਕਿਤ ID ਹੈ — ਜੋ ਇਸ ਦੀ ਸਥਿਤੀ ਨੂੰ ਚਿੰਨ੍ਹਤ ਕਰਦਾ ਹੈ। Consumers offsets ਨੂੰ ਟ੍ਰੈਕ ਕਰਦੇ ਅਤੇ commit ਕਰਦੇ ਹਨ ਤਾਕਿ ਉਹ ਜਾਣ ਸਕਣ ਕਿ ਉਹਨਾਂ ਨੇ ਕੀ ਖਪਤ ਕੀਤਾ ਹੈ, ਦੋਬਾਰਾ ਸ਼ੁਰੂ ਕਰਨਾ, replay, ਅਤੇ ਭਰੋਸੇਮੰਦ processing ਨੂੰ ਸਮਰਥ ਬਣਾਉਂਦੇ ਹਨ।
Offsets ਕੀ ਹਨ
OFFSET → the position/ID of an event within a PARTITION:
→ each partition is an ordered log; events get incrementing offsets (0, 1, 2, ...)
→ an offset uniquely identifies an event's position in its partition
→ events are RETAINED → the log keeps events (offsets remain valid for the retention period)
Consumers offsets ਨੂੰ ਕਿਵੇਂ ਵਰਤਦੇ ਹਨ
→ a consumer reads events in order and tracks its CURRENT offset (where it has read to)
→ COMMITTING an offset → records "I've processed up to here" → on restart, resume from
the committed offset (don't reprocess everything)
→ consumers can SEEK to any offset → REPLAY old events, skip ahead, reprocess from a point
→ each consumer GROUP tracks its own offsets per partition (independent progress)
