fix outdated references to DEFAULT_STREAMS_CONFIG_BEAN_NAME
Fix existing code that show declaration of bean DEFAULT_STREAMS_CONFIG_BEAN_NAME as a `Properties` object or a `StreamsConfig` object.
This commit is contained in:
committed by
Gary Russell
parent
64a8a7bb3a
commit
ee240006b3
@@ -35,7 +35,7 @@ import org.springframework.context.annotation.Import;
|
||||
* public class AppConfig {
|
||||
*
|
||||
* @Bean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME)
|
||||
* public StreamsConfig kStreamsConfigs() {
|
||||
* public KafkaStreamsConfiguration kStreamsConfigs() {
|
||||
* ...
|
||||
* }
|
||||
* // other @Bean definitions
|
||||
|
||||
@@ -64,7 +64,8 @@ public class KafkaStreamsDefaultConfiguration {
|
||||
else {
|
||||
throw new UnsatisfiedDependencyException(KafkaStreamsDefaultConfiguration.class.getName(),
|
||||
DEFAULT_STREAMS_BUILDER_BEAN_NAME, "streamsConfig", "There is no '" +
|
||||
DEFAULT_STREAMS_CONFIG_BEAN_NAME + "' Properties bean in the application context.\n" +
|
||||
DEFAULT_STREAMS_CONFIG_BEAN_NAME + "' " + KafkaStreamsConfiguration.class.getName() +
|
||||
" bean in the application context.\n" +
|
||||
"Consider declaring one or don't use @EnableKafkaStreams.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,11 +227,11 @@ public class KafkaStreamsTests {
|
||||
private String brokerAddresses;
|
||||
|
||||
@Bean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME)
|
||||
public StreamsConfig kStreamsConfigs() {
|
||||
public KafkaStreamsConfiguration kStreamsConfigs() {
|
||||
Map<String, Object> props = new HashMap<>();
|
||||
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "testStreams");
|
||||
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, this.brokerAddresses);
|
||||
return new StreamsConfig(props);
|
||||
return new KafkaStreamsConfiguration(props);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user