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:11:00 UTC

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

     [ https://issues.apache.org/jira/browse/KAFKA-19694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lucas Brutschy updated KAFKA-19694:
-----------------------------------
    Description: 
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.

In the {{{}StreamsRebalanceListener{}}}, we 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{}}}.

  was:
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{}}}.


> 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
>            Assignee: Lucas Brutschy
>            Priority: Major
>
> 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.
> In the {{{}StreamsRebalanceListener{}}}, we 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)