liveBook · Manning

Consumer lag

Consumer lag measures how much a consumer’s processing position trails the latest available data or events.

How 3 Manning books explain it

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.

Read how Apache Kafka in Action explains consumer lag →

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.

Read how Kafka for Architects explains consumer lag →

What to know first

Related concepts

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.