diff --git a/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.java b/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.java index eb22c3f567e0..cdd5b8ff2e31 100644 --- a/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.java +++ b/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.java @@ -27,18 +27,16 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.kafka.annotation.EnableKafkaStreams; +import org.springframework.kafka.support.serializer.JacksonJsonSerde; @Configuration(proxyBeanMethods = false) @EnableKafkaStreams public class MyKafkaStreamsConfiguration { @Bean - @SuppressWarnings({ "deprecation", "removal" }) public KStream kStream(StreamsBuilder streamsBuilder) { KStream stream = streamsBuilder.stream("ks1In"); - stream.map(this::uppercaseValue) - .to("ks1Out", - Produced.with(Serdes.Integer(), new org.springframework.kafka.support.serializer.JsonSerde<>())); + stream.map(this::uppercaseValue).to("ks1Out", Produced.with(Serdes.Integer(), new JacksonJsonSerde<>())); return stream; } diff --git a/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.kt b/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.kt index 0b569339bb22..3e7322543970 100644 --- a/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.kt +++ b/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.kt @@ -24,6 +24,7 @@ import org.apache.kafka.streams.kstream.Produced import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.kafka.annotation.EnableKafkaStreams +import org.springframework.kafka.support.serializer.JacksonJsonSerde @Suppress("UNUSED_PARAMETER") @Configuration(proxyBeanMethods = false) @@ -31,11 +32,9 @@ import org.springframework.kafka.annotation.EnableKafkaStreams class MyKafkaStreamsConfiguration { @Bean - @Suppress("DEPRECATION") fun kStream(streamsBuilder: StreamsBuilder): KStream { val stream = streamsBuilder.stream("ks1In") - stream.map(this::uppercaseValue).to("ks1Out", Produced.with(Serdes.Integer(), - org.springframework.kafka.support.serializer.JsonSerde())) + stream.map(this::uppercaseValue).to("ks1Out", Produced.with(Serdes.Integer(), JacksonJsonSerde())) return stream }