Consumer lag
Consumer lag measures how much a consumer’s processing position trails the latest available data or events.
Apache Kafka in Action
A consumer lag metric reports replication lag separately for each follower, topic, and partition.
- How it is used
- Tracks replication delay separately for each follower, topic, and partition.
- How deep it goes
- Defines the metric's scope and operating expectations, but does not give a collection command or alert threshold.
- Examples
- Uses leader-and-follower replication as its operating case; offset tables illustrate the distinct consumer-group lag.
- What you can do after
- Diagnose/debug with it by locating a lagging follower, topic, and partition and watching for progressively increasing delay.
Microservices Patterns, Second Edition
The number of events a consumer or view has yet to process.
- How it is used
- Tracks the event-processing backlog of a CQRS view as an operational metric.
- How deep it goes
- Defines lag as unprocessed events and pairs it with end-to-end latency for monitoring, without giving calculation or alert thresholds.
- Examples
- Uses a view awaiting provider-service events, where a client may query before the view reflects a committed change.
- What you can do after
- Diagnose delayed or stalled view updates by monitoring unprocessed events alongside end-to-end latency.
Read how Microservices Patterns, Second Edition explains consumer lag →
Kafka for Architects
Lag is the amount by which processing or consumption falls behind the latest available data.
- How it is used
- Guides consumer scaling and operational monitoring by revealing whether a consumer group keeps pace with incoming records.
- How deep it goes
- Defines lag, gives JMX and offset-based calculations, and notes missing-offset inaccuracies without detailing metric implementation.
- Examples
- Uses a customer aggregation consumer and a partition-offset diagram to make backlog measurement concrete.
- What you can do after
- Diagnose processing backlogs and evaluate when consumer instances or monitoring investigation may be necessary.
What to know first
- log compactionLog compaction is a storage technique that retains the latest record for each key while removing superseded records.
Related concepts
- consumer groupmeasures · A consumer group is a logical set of message consumers that consume one or more streams under a shared group identity, with message delivery coordinated among its members.
- CQRSused by · CQRS is an architectural pattern that separates operations and models for changing application state from those for reading or querying it.
- monitoringmeasured by · Monitoring is the ongoing observation and measurement of a system or process to assess its behavior or condition and detect changes, failures, or other problems.
- offsetuses · An offset is a position or displacement measured relative to a reference point, such as within an ordered sequence, memory region, or layout.
- lagkind of · A lag is a temporal or positional offset that associates an observation with an earlier observation in an ordered sequence or time series.
Questions about consumer lag
What is consumer lag?
Consumer lag measures how much a consumer’s processing position trails the latest available data or events.
Which Manning books explain consumer lag?
Apache Kafka in Action, Microservices Patterns, Second Edition and Kafka for Architects.
What should I know before learning consumer lag?
Manning books that teach consumer lag usually introduce log compaction first.
What is the difference between consumer lag and max lag metric?
Consumer lag measures how much a consumer’s processing position trails the latest available data or events. A max lag metric reports the greatest replication lag between a broker or leader replica and its followers.
What is consumer lag a kind of?
Consumer lag is a kind of lag. A lag is a temporal or positional offset that associates an observation with an earlier observation in an ordered sequence or time series.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


