# Solution 01 — Your first message

*Attempt the exercise first — this file is the post-mortem, not the
shortcut.*

## What the verified run showed

```
--- read 1 (fresh group, latest):          → (nothing; exits after 4 s)
--- read 2 (same group, --from-beginning): → (nothing)
--- read 3 (fresh group, --from-beginning):
hello
world
kafka

--- group ledger:
GROUP          TOPIC        PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG
course.readers course.notes 0          3               3               0
```

## The three sentences

1. **Kafka is a durable log, not a queue.** Read 3 saw all three records
   after two full "consumptions" — records leave when *retention* says so,
   never because someone read them.
2. **A consumer group's offset is a cursor, and the cursor is the only
   thing reading moves.** Read 1 started at the log end
   (`auto.offset.reset=latest` for a group with no committed offset) and —
   the part most people miss — **committed offset 3 on its way out**, so
   read 2's `--from-beginning` was overridden by the group's own ledger.
   The flag only decides where a *new* group starts.
3. **Committed state lives with the group, not in the record.** The
   describe's `CURRENT-OFFSET 3` against `LOG-END-OFFSET 3` is the whole
   consumption story: the cursor reached the end; the log never noticed.

## The understanding checks, answered

1. `--from-beginning` stops being a rewind the moment the group has a
   committed offset — the group's ledger always wins over the flag.
   (`auto.offset.reset` applies only when no committed offset exists —
   Kafka docs, *Consumer Configs*.)
2. Most learners predict read 2 shows three records. The wrong assumption:
   that `--from-beginning` is a command to the broker, rather than a
   default for a group with no memory.
3. A crash before the commit means the next start resumes from the **last
   committed offset** — the record is *re-delivered*. That is at-least-once
   delivery, and it is why every handler must tolerate duplicates
   (idempotency — the thread Exercises 03–05 pull on).

## What this buys you in production

Every "my consumer saw zero messages" incident is read 1 misread as "Kafka
lost my data". Every "I asked for --from-beginning and got nothing" ticket
is read 2. You have now personally caused and explained both.
