Skip to content

Add configuration property for leaveGroupOnClose in Kafka Streams#50432

Open
taasjord wants to merge 1 commit into
spring-projects:mainfrom
taasjord:leave-group-on-close-prop
Open

Add configuration property for leaveGroupOnClose in Kafka Streams#50432
taasjord wants to merge 1 commit into
spring-projects:mainfrom
taasjord:leave-group-on-close-prop

Conversation

@taasjord
Copy link
Copy Markdown

@taasjord taasjord commented May 14, 2026

Setting the option to leave the group on close in Kafka Streams is often a deployment time concern rather than at build time, eg. for rolling deployments in Kubernetes.

Earlier there was a "internal.leave.group.on.close" property in Kafka Streams, but this has been removed and been replaced by API option in KafkaStreams.close that the StreamsBuilderFactoryBean uses, but could only by set with StreamsBuilderFactoryBean.setLeaveGroupOnClose(true) in code.

This change makes it possible again to set the option to leave the group on close at configuration/deployment time using the application properties:

spring:
  kafka:
     streams:
       leave-group-on-close: true

The default is false, which is the same as StreamsBuilderFactoryBean.leaveGroupOnClose default, so there should be no change in behaviour unless the property is explicitly set.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 14, 2026
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 14, 2026
@wilkinsona wilkinsona added this to the 4.x milestone May 14, 2026
@taasjord taasjord force-pushed the leave-group-on-close-prop branch from 2f17afd to 4c75fa1 Compare May 14, 2026 11:37
This makes it possible to set the option to leave the group on
close at configuration/deployment time in the application properties.

Signed-off-by: Trygve Aasjord <taasjord@users.noreply.github.com>
@taasjord taasjord force-pushed the leave-group-on-close-prop branch from 4c75fa1 to 11ab2d7 Compare May 14, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants