You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Lucas Brutschy (Jira)" <ji...@apache.org> on 2025/09/09 12:10:00 UTC

[jira] [Created] (KAFKA-19694) StreamsRebalanceListener is not triggered on Consumer.close()

Lucas Brutschy created KAFKA-19694:
--------------------------------------

             Summary: StreamsRebalanceListener is not triggered on Consumer.close()
                 Key: KAFKA-19694
                 URL: https://issues.apache.org/jira/browse/KAFKA-19694
             Project: Kafka
          Issue Type: Sub-task
          Components: streams
            Reporter: Lucas Brutschy


In the consumer, we invoke the consumer rebalance {{onPartitionRevoked}} or {{onPartitionLost}} callbacks, when the consumer closes. The point is that the application may want to commit, or wipe the state if we are closing unsuccessfully.

When Bruno added the {{{}StreamsRebalanceListener{}}}, he did not implement this behavior, which means when closing the consumer we may lose some progress, and in the worst case also miss that we have to wipe our local state state since we got fenced.

We should implement something like the {{ConsumerRebalanceListenerInvoker}} and invoke it in {{{}Consumer.close{}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)