spring-cloud / spring-cloud/spring-cloud-stream

KafkaBinderMetrics not updating last stable offset

Open
#3,208 4 comments 1 reaction 1 assignee View on GitHub

@olegz is already working on this.

Since Aug 7, 2026.

bug
Dominant language
Java
Stars
1.1k
Forks
646
Avg merge
2d 3h
Merged PRs (30d)
8

Description

Describe the issue

Since our recent Spring / Kafka update the KafkaBinderMetrics repeatedly triggers the following warning log message:

Not updating last stable offset for partition <partition> as it is no longer assigned

This is happening for a lot of partitions and every x seconds, this generates a big flood of logs for us.

This is probably related to the following Kafka Issue: https://issues.apache.org/jira/browse/KAFKA-20449

However this ticket is only aiming to reduce the log level since it´s a benign race condition during rebalances. As the KafkaBinderMetrics should not triggering any rebalances nor does our log give any indication that rebalances are happening I don´t think the situation described in this kafka-issue is quite fitting. As such it rather indicates some underlying issue with the KafkaBinderMetrics.computeUnconsumedMessages(..).

To Reproduce
Starting a Spring Cloud Kafka Application, while enabling the KafkaBinderMetrics.
OffsetFetcherUtils log level should be set to at least "warn"

Version of the framework
spring-boot 4.0.6
spring-cloud-stream 5.0.1
spring-kafka 4.0.5
kafka-clients 4.1.2

Expected behavior
KafkaBinderMetrics should not trigger the mentioned log messages.

Screenshots

Here an exempt from our most recent logs, to illustrate the sheir amount of messages we get from this issue:

Image

Additional context
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.