diff --git a/spring-kafka-docs/src/main/asciidoc/appendix.adoc b/spring-kafka-docs/src/main/asciidoc/appendix.adoc index 41540b18..7c19a7b5 100644 --- a/spring-kafka-docs/src/main/asciidoc/appendix.adoc +++ b/spring-kafka-docs/src/main/asciidoc/appendix.adoc @@ -2,50 +2,35 @@ == Override Spring Boot Dependencies When using Spring for Apache Kafka in a Spring Boot application, the Apache Kafka dependency versions are determined by Spring Boot's dependency management. -If you wish to use a different version of `kafka-clients` or `kafka-streams`, you need to override all of the associated dependencies. -This is especially true when using the embedded Kafka broker in `spring-kafka-test`. +If you wish to use a different version of `kafka-clients` or `kafka-streams`, and use the embedded kafka broker for testing, you need to override their version used by Spring Boot dependency management and add two `test` artifacts for Apache Kafka. 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]. 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. -When using 2.8.1, you also need to exclude `spring-kafka-test` 's `zookeeper` dependency. +When using 2.8.1, you also need to exclude `zookeeper` dependency from `spring-kafka-test`. ==== [source, xml, subs="+attributes", role="primary"] .Maven ---- + + 2.8.1 + + org.springframework.kafka spring-kafka - {project-version} + + + + org.apache.kafka + kafka-streams org.springframework.kafka spring-kafka-test - {project-version} test - - - - org.apache.kafka - kafka-clients - {kafka-version} - - - - - org.apache.kafka - kafka-streams - {kafka-version} - - - - org.apache.kafka - kafka-clients - {kafka-version} - test - test - + org.apache.zookeeper @@ -56,37 +41,35 @@ When using 2.8.1, you also need to exclude `spring-kafka-test` 's `zookeeper` de org.apache.kafka - kafka_2.13 - {kafka-version} + kafka-clients + test test + ${kafka.version} org.apache.kafka kafka_2.13 - {kafka-version} test test + ${kafka.version} ---- [source, groovy, subs="+attributes", role="secondary"] .Gradle ---- +ext['kafka.version'] = '2.8.1' + dependencies { - - implementation 'org.springframework.kafka:spring-kafka:{project-version}' - - implementation "org.apache.kafka:kafka-clients:$kafkaVersion" - implementation "org.apache.kafka:kafka-streams:$kafkaVersion" // optional - only needed when using kafka-streams - testImplementation ('org.springframework.kafka:spring-kafka-test:{project-version}') { - // needed if downgrading to Apache Kafka 2.8.1 - exclude group: 'org.apache.zookeeper', module: 'zookeeper' - } - testImplementation "org.apache.kafka:kafka-clients:$kafkaVersion:test" - testImplementation "org.apache.kafka:kafka_2.13:$kafkaVersion" - testImplementation "org.apache.kafka:kafka_2.13:$kafkaVersion:test" - + implementation 'org.springframework.kafka:spring-kafka' + implementation "org.apache.kafka:kafka-streams" // optional - only needed when using kafka-streams + testImplementation ('org.springframework.kafka:spring-kafka-test') { + // needed if downgrading to Apache Kafka 2.8.1 + exclude group: 'org.apache.zookeeper', module: 'zookeeper' + } + testImplementation "org.apache.kafka:kafka-clients:${kafka.version}:test" + testImplementation "org.apache.kafka:kafka_2.13:${kafka.version}:test" } ---- ====