Skip to content

Commit 4a46f0d

Browse files
committed
Remove the deprectated DSL_STORE_CONFIG property
`StreamsConfig.DEFAULT_DSL_STORE_CONFIG` (`default.dsl.store`) is deprecated in Kafka Streams `3.7.0` in preference to `DslStoreSuppliers`. Remove using this property in the test that verifying in-memory state stores and use the `DslStoreSuppliers` mechanism instead. See KIP-954 for more details https://cwiki.apache.org/confluence/display/KAFKA/KIP-954%3A+expand+default+DSL+store+configuration+to+custom+types
1 parent 5446be0 commit 4a46f0d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spring-kafka/src/test/java/org/springframework/kafka/config/StreamsBuilderFactoryBeanInMemoryStateStoreTests.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@
2525
import java.util.Map;
2626

2727
import org.apache.kafka.common.serialization.Serdes;
28+
import org.apache.kafka.common.utils.Bytes;
2829
import org.apache.kafka.streams.StreamsBuilder;
2930
import org.apache.kafka.streams.StreamsConfig;
3031
import org.apache.kafka.streams.kstream.KStream;
3132
import org.apache.kafka.streams.kstream.KTable;
3233
import org.apache.kafka.streams.kstream.Materialized;
34+
import org.apache.kafka.streams.state.BuiltInDslStoreSuppliers;
35+
import org.apache.kafka.streams.state.KeyValueStore;
3336
import org.junit.jupiter.api.BeforeAll;
3437
import org.junit.jupiter.api.Test;
3538

@@ -45,6 +48,7 @@
4548

4649
/**
4750
* @author Cédric Schaller
51+
* @author Soby Chacko
4852
*/
4953
@SpringJUnitConfig
5054
@DirtiesContext
@@ -80,18 +84,16 @@ public KafkaStreamsConfiguration kStreamsConfigWithInMemoryStateStores() {
8084
props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.StringSerde.class);
8185
props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.StringSerde.class);
8286
props.put(StreamsConfig.STATE_DIR_CONFIG, stateStoreDir.toString());
83-
84-
// Property introduced with KIP-591 (Kafka 3.2) and deprecated (but still supported) with Kafka 3.7
85-
props.put(StreamsConfig.DEFAULT_DSL_STORE_CONFIG, "in_memory");
8687
return new KafkaStreamsConfiguration(props);
8788
}
8889

8990
@Bean
9091
public KTable<?, ?> table(StreamsBuilder builder) {
9192
KStream<Object, Object> stream = builder.stream("source-topic");
92-
return stream.groupByKey()
93-
.count(Materialized.as("store"));
94-
93+
return stream
94+
.groupByKey()
95+
.count(Materialized.<Object, Long, KeyValueStore<Bytes, byte[]>>as("store")
96+
.withStoreType(BuiltInDslStoreSuppliers.IN_MEMORY));
9597
}
9698
}
9799
}

0 commit comments

Comments
 (0)