Demo: what a rebalance does to in-flight messages
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
observe duplicate delivery on rebalance. Prepares MID-028-LAB1.
Draft outline details
Step by step
- Start two
inventoryconsumers; note partition assignments. - Make the handler slow (5 s) and record each processed
eventId. - Kill one consumer mid-processing; watch partitions reassign.
- The surviving consumer re-reads from the last committed offset; show a message processed twice.
- Planned mistake: enable auto-commit before processing and show a message lost on a crash. Fix by committing after processing.
- Add an idempotency check on
eventIdand replay; the duplicate no longer has an effect.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.