Skip to content

Commit c061fce

Browse files
garyrussellartembilan
authored andcommitted
GH-2018: Docs - Downgrading to Apache Kafka 2.8.1
Resolves #2018
1 parent 319c114 commit c061fce

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

spring-kafka-docs/src/main/asciidoc/appendix.adoc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
////
21
[[update-deps]]
32
== Override Spring Boot Dependencies
43

54
When using Spring for Apache Kafka in a Spring Boot application, the Apache Kafka dependency versions are determined by Spring Boot's dependency management.
6-
If you wish to use a different version of `kafka-clients` or `kafka-streams`, such as 3.0.0, you need to override all of the associated dependencies.
5+
If you wish to use a different version of `kafka-clients` or `kafka-streams`, you need to override all of the associated dependencies.
76
This is especially true when using the embedded Kafka broker in `spring-kafka-test`.
87

9-
IMPORTANT: Backwards compatibility is not supported for all Boot versions; Spring for Apache Kafka 2.8 has been tested with Spring Boot 2.5 and 2.6.
10-
11-
IMPORTANT: When using the 3.0.0 clients, the default `EOSMode.V2` is not supported unless the broker is 2.5 or higher; if you wish to use the 3.0.0 clients with an earlier broker, you must change the container's `EOSMode` to `V1`.
8+
IMPORTANT: There is a bug in Apache Kafka 3.0.0 when running the embedded broker on Microsoft Windows https://issues.apache.org/jira/browse/KAFKA-13391[KAFKA-13391].
9+
To use the embedded broker on Windows, you need to downgrade the Apache Kafka version to 2.8.1 until 3.0.1 is available.
10+
When using 2.8.1, you also need to exclude `spring-kafka-test` 's `zookeeper` dependency.
1211

1312
====
1413
[source, xml, subs="+attributes", role="primary"]
@@ -46,6 +45,13 @@ IMPORTANT: When using the 3.0.0 clients, the default `EOSMode.V2` is not support
4645
<version>{kafka-version}</version>
4746
<classifier>test</classifier>
4847
<scope>test</scope>
48+
<!-- needed if downgrading to Apache Kafka 2.8.1 -->
49+
<exclusions>
50+
<exclusion>
51+
<groupId>org.apache.zookeeper</groupId>
52+
<artifactId>zookeeper</artifactId>
53+
</exclusion>
54+
</exclusions>
4955
</dependency>
5056
5157
<dependency>
@@ -73,7 +79,10 @@ dependencies {
7379
7480
implementation "org.apache.kafka:kafka-clients:$kafkaVersion"
7581
implementation "org.apache.kafka:kafka-streams:$kafkaVersion" // optional - only needed when using kafka-streams
76-
testImplementation 'org.springframework.kafka:spring-kafka-test:{project-version}'
82+
testImplementation ('org.springframework.kafka:spring-kafka-test:{project-version}') {
83+
// needed if downgrading to Apache Kafka 2.8.1
84+
exclude group: 'org.apache.zookeeper', module: 'zookeeper'
85+
}
7786
testImplementation "org.apache.kafka:kafka-clients:$kafkaVersion:test"
7887
testImplementation "org.apache.kafka:kafka_2.13:$kafkaVersion"
7988
testImplementation "org.apache.kafka:kafka_2.13:$kafkaVersion:test"
@@ -83,7 +92,6 @@ dependencies {
8392
====
8493

8594
The test scope dependencies are only needed if you are using the embedded Kafka broker in tests.
86-
////
8795

8896
[appendix]
8997
[[history]]

0 commit comments

Comments
 (0)