intermediate~3h
Building the Consumer Microservice
The producer's events are only useful once something reads them. This module wires up @KafkaListener and works through the offset-management decisions that actually matter in production.
Learning objectives
- Beginner: A single-instance consumer with default auto-commit, fine for a low-stakes dev environment where occasional reprocessing is harmless.
- Intermediate: Manual acknowledgment tied to a successful database write, plus concurrency matched to partition count for real throughput.
- Advanced: Combine manual acknowledgment with idempotent upserts in the service layer (Module 10) and DLT-based recovery (Module 14) so at-least-once delivery can never corrupt state, even under repeated rebalances.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.
Building the Consumer Microservice