Skip to content

Add configuration property for leaveGroupOnClose in Kafka Streams#50432

Merged
snicoll merged 2 commits into
spring-projects:mainfrom
taasjord:leave-group-on-close-prop
Jul 16, 2026
Merged

Add configuration property for leaveGroupOnClose in Kafka Streams#50432
snicoll merged 2 commits into
spring-projects:mainfrom
taasjord:leave-group-on-close-prop

Conversation

@taasjord

@taasjord taasjord commented May 14, 2026

Copy link
Copy Markdown
Contributor

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 2 times, most recently from 4c75fa1 to 11ab2d7 Compare May 14, 2026 12:15
@wilkinsona wilkinsona modified the milestones: 4.x, 4.2.x Jun 28, 2026
@snicoll snicoll self-assigned this Jul 15, 2026
@snicoll
snicoll force-pushed the leave-group-on-close-prop branch from 11ab2d7 to 2e48aa3 Compare July 15, 2026 09:59
snicoll pushed a commit to taasjord/spring-boot that referenced this pull request Jul 15, 2026
This commit makes it possible to set the option to leave the group on
close at configuration/deployment time using configuration.

See spring-projectsgh-50432

Signed-off-by: Trygve Aasjord <taasjord@users.noreply.github.com>
snicoll added a commit to taasjord/spring-boot that referenced this pull request Jul 15, 2026
taasjord and others added 2 commits July 16, 2026 11:37
This commit makes it possible to set the option to leave the group on
close at configuration/deployment time using configuration.

See spring-projectsgh-50432

Signed-off-by: Trygve Aasjord <taasjord@users.noreply.github.com>
@snicoll
snicoll force-pushed the leave-group-on-close-prop branch from 2e48aa3 to 1383d34 Compare July 16, 2026 09:37
@snicoll snicoll modified the milestones: 4.2.x, 4.2.0-M1 Jul 16, 2026
@snicoll snicoll closed this in 66b7a98 Jul 16, 2026
@snicoll
snicoll merged commit 66b7a98 into spring-projects:main Jul 16, 2026
1 check failed
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.

4 participants