Skip to content

Commit 6df1caf

Browse files
committed
Auto-configure transactions when using spring-boot-kafka
spring-kafka has an api dependency on spring-tx, placing the latter on the compile classpath of the former's consumers. Additionally, when spring.kafka.producer.transaction-id-prefix is set, the Kafka auto-configuration will define a Kafka-based transaction manager. However, the transaction manager won't be used without some configuration from the user as there's no dependency on spring-boot-transaction and, therefore, no auto-configuration of @EnableTransactionManagement. This commit adds a spring-boot-transaction dependency to spring-boot-kafka, aligning it with the spring-tx dependency that spring-kafka already has. Fixes gh-48880
1 parent 9e374fe commit 6df1caf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

module/spring-boot-kafka/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ description = "Spring Boot Kafka"
2727

2828
dependencies {
2929
api(project(":core:spring-boot"))
30+
api(project(":module:spring-boot-transaction"))
3031
api("org.springframework.kafka:spring-kafka")
3132

3233
optional(project(":core:spring-boot-autoconfigure"))

0 commit comments

Comments
 (0)