|
2 | 2 | == Override Spring Boot Dependencies
|
3 | 3 |
|
4 | 4 | When using Spring for Apache Kafka in a Spring Boot application, the Apache Kafka dependency versions are determined by Spring Boot's dependency management.
|
5 |
| -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. |
| 5 | +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; set the `kafka.version` property. |
| 6 | + |
| 7 | +Or, to use a different Spring for Apache Kafka version with a supported Spring Boot version, set the `spring-kafka.version` property. |
6 | 8 |
|
7 | 9 | Or, to use a different Spring for Apache Kafka version with a supported Spring Boot version, set the `spring-kafka.version` property.
|
8 | 10 | For example, {project-version} is supported by Spring Boot 2.7.x which brings in 2.8.x by default.
|
@@ -41,13 +43,8 @@ ext['spring-kafka.version'] = '{project-version}'
|
41 | 43 |
|
42 | 44 | dependencies {
|
43 | 45 | implementation 'org.springframework.kafka:spring-kafka'
|
44 |
| - implementation "org.apache.kafka:kafka-streams" // optional - only needed when using kafka-streams |
45 |
| - testImplementation ('org.springframework.kafka:spring-kafka-test') { |
46 |
| - // needed if downgrading to Apache Kafka 2.8.1 |
47 |
| - exclude group: 'org.apache.zookeeper', module: 'zookeeper' |
48 |
| - } |
49 |
| - testImplementation "org.apache.kafka:kafka-clients:${kafka.version}:test" |
50 |
| - testImplementation "org.apache.kafka:kafka_2.13:${kafka.version}:test" |
| 46 | + implementation 'org.apache.kafka:kafka-streams' // optional - only needed when using kafka-streams |
| 47 | + testImplementation 'org.springframework.kafka:spring-kafka-test' |
51 | 48 | }
|
52 | 49 | ----
|
53 | 50 | ====
|
|
0 commit comments