Skip to content

Commit 10d37b7

Browse files
committed
Adapt to restructuring changes in Spring Boot 4.0
This commit updates imports and dependencies to adapt to Spring Boot 4.0's restructuring. This commit also stops using some APIs that were deprecated in Spring Boot 3.x. Signed-off-by: Andy Wilkinson <[email protected]>
1 parent 131747e commit 10d37b7

File tree

57 files changed

+174
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+174
-153
lines changed

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
</organization>
1818

1919
<dependencies>
20+
<dependency>
21+
<groupId>org.springframework.boot</groupId>
22+
<artifactId>spring-boot-kafka</artifactId>
23+
</dependency>
2024
<dependency>
2125
<groupId>org.springframework.cloud</groupId>
2226
<artifactId>spring-cloud-stream</artifactId>

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/AbstractKafkaBinderHealthIndicator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2023 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
import org.apache.kafka.common.PartitionInfo;
3333

3434
import org.springframework.beans.factory.DisposableBean;
35-
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
36-
import org.springframework.boot.actuate.health.Health;
37-
import org.springframework.boot.actuate.health.Status;
3835
import org.springframework.boot.actuate.health.StatusAggregator;
36+
import org.springframework.boot.health.contributor.AbstractHealthIndicator;
37+
import org.springframework.boot.health.contributor.Health;
38+
import org.springframework.boot.health.contributor.Status;
3939
import org.springframework.kafka.core.ConsumerFactory;
4040
import org.springframework.util.Assert;
4141

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationProperties.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2024 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,8 +37,8 @@
3737
import org.apache.kafka.clients.producer.ProducerConfig;
3838

3939
import org.springframework.beans.factory.ObjectProvider;
40-
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
41-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
40+
import org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails;
41+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
4242
import org.springframework.cloud.stream.binder.HeaderMode;
4343
import org.springframework.cloud.stream.binder.ProducerProperties;
4444
import org.springframework.cloud.stream.binder.kafka.properties.KafkaProducerProperties.CompressionType;
@@ -402,7 +402,7 @@ public void setProducerProperties(Map<String, String> producerProperties) {
402402
public Map<String, Object> mergedConsumerConfiguration() {
403403
Map<String, Object> consumerConfiguration = new HashMap<>(this.kafkaProperties.buildConsumerProperties());
404404
if (this.kafkaConnectionDetails != null) {
405-
consumerConfiguration.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, this.kafkaConnectionDetails.getConsumerBootstrapServers());
405+
consumerConfiguration.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, this.kafkaConnectionDetails.getConsumer().getBootstrapServers());
406406
}
407407
// Copy configured binder properties that apply to consumers
408408
// allow schema registry properties to be propagated to consumer configuration
@@ -431,7 +431,7 @@ public Map<String, Object> mergedConsumerConfiguration() {
431431
public Map<String, Object> mergedProducerConfiguration() {
432432
Map<String, Object> producerConfiguration = new HashMap<>(this.kafkaProperties.buildProducerProperties());
433433
if (this.kafkaConnectionDetails != null) {
434-
producerConfiguration.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, this.kafkaConnectionDetails.getProducerBootstrapServers());
434+
producerConfiguration.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, this.kafkaConnectionDetails.getProducer().getBootstrapServers());
435435
}
436436
// Copy configured binder properties that apply to producers
437437
for (Map.Entry<String, String> configurationEntry : this.configuration

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,8 +55,8 @@
5555
import org.apache.kafka.common.errors.UnknownTopicOrPartitionException;
5656

5757
import org.springframework.beans.factory.InitializingBean;
58-
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
59-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
58+
import org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails;
59+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
6060
import org.springframework.cloud.stream.binder.BinderException;
6161
import org.springframework.cloud.stream.binder.ExtendedConsumerProperties;
6262
import org.springframework.cloud.stream.binder.ExtendedProducerProperties;
@@ -186,7 +186,7 @@ public KafkaTopicProvisioner(
186186
private Map<String, Object> createAdminClientProperties(KafkaProperties properties, KafkaConnectionDetails connectionDetails) {
187187
Map<String, Object> adminProperties = properties.buildAdminProperties();
188188
if (connectionDetails != null) {
189-
adminProperties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, connectionDetails.getAdminBootstrapServers());
189+
adminProperties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, connectionDetails.getAdmin().getBootstrapServers());
190190
}
191191
return adminProperties;
192192
}

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationPropertiesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2024 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
2929
import org.junit.jupiter.api.Test;
3030

3131
import org.springframework.beans.factory.ObjectProvider;
32-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
32+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
3333
import org.springframework.core.io.ClassPathResource;
3434

3535
import static org.assertj.core.api.Assertions.assertThat;

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisionerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2024 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
2828
import org.junit.jupiter.api.Test;
2929

3030
import org.springframework.beans.factory.ObjectProvider;
31-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
31+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
3232
import org.springframework.cloud.stream.binder.kafka.properties.KafkaBinderConfigurationProperties;
3333
import org.springframework.core.io.ClassPathResource;
3434
import org.springframework.kafka.test.utils.KafkaTestUtils;

binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
<artifactId>spring-boot-autoconfigure</artifactId>
3838
<optional>true</optional>
3939
</dependency>
40+
<dependency>
41+
<groupId>org.springframework.boot</groupId>
42+
<artifactId>spring-boot-web-server</artifactId>
43+
<optional>true</optional>
44+
</dependency>
4045
<dependency>
4146
<groupId>org.apache.kafka</groupId>
4247
<artifactId>kafka-streams</artifactId>

binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/GlobalKTableBinderConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2024 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@
2222
import org.springframework.beans.factory.annotation.Qualifier;
2323
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
25-
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
26-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
2725
import org.springframework.boot.context.properties.EnableConfigurationProperties;
26+
import org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails;
27+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
2828
import org.springframework.cloud.stream.binder.kafka.provisioning.AdminClientConfigCustomizer;
2929
import org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner;
3030
import org.springframework.cloud.stream.binder.kafka.streams.properties.KafkaStreamsBinderConfigurationProperties;

binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/KStreamBinderConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 the original author or authors.
2+
* Copyright 2017-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
1919
import org.springframework.beans.factory.ObjectProvider;
2020
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
2121
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
22-
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
23-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
2422
import org.springframework.boot.context.properties.EnableConfigurationProperties;
23+
import org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails;
24+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
2525
import org.springframework.cloud.stream.binder.kafka.provisioning.AdminClientConfigCustomizer;
2626
import org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner;
2727
import org.springframework.cloud.stream.binder.kafka.streams.properties.KafkaStreamsBinderConfigurationProperties;

binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/KTableBinderConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2024 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@
2222
import org.springframework.beans.factory.annotation.Qualifier;
2323
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
25-
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
26-
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
2725
import org.springframework.boot.context.properties.EnableConfigurationProperties;
26+
import org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails;
27+
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
2828
import org.springframework.cloud.stream.binder.kafka.provisioning.AdminClientConfigCustomizer;
2929
import org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner;
3030
import org.springframework.cloud.stream.binder.kafka.streams.properties.KafkaStreamsBinderConfigurationProperties;

0 commit comments

Comments
 (0)