Skip to content

Commit f4adf1e

Browse files
committed
Streams config - remove unused conversion service
1 parent 4f67c23 commit f4adf1e

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

spring-kafka/src/main/java/org/springframework/kafka/config/KafkaStreamsConfiguration.java

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
package org.springframework.kafka.config;
1818

1919
import java.util.HashMap;
20-
import java.util.List;
2120
import java.util.Map;
2221
import java.util.Properties;
2322

24-
import org.springframework.core.convert.converter.Converter;
25-
import org.springframework.core.convert.support.DefaultConversionService;
2623
import org.springframework.util.Assert;
2724

2825
/**
29-
* Wrapper for {@link org.apache.kafka.streams.StreamsBuilder} properties.
26+
* Wrapper for {@link org.apache.kafka.streams.StreamsBuilder} properties. The framework
27+
* looks for a bean of this type with name 'defaultKafkaStreamsConfig' and auto-declares a
28+
* {@link StreamsBuilderFactoryBean} using it. The {@link Properties} class is too general
29+
* for such activity.
3030
*
3131
* @author Gary Russell
3232
* @since 2.2
@@ -36,32 +36,11 @@ public class KafkaStreamsConfiguration {
3636

3737
private final Map<String, Object> configs;
3838

39-
private final DefaultConversionService conversionService = new DefaultConversionService();
40-
4139
private Properties properties;
4240

4341
public KafkaStreamsConfiguration(Map<String, Object> configs) {
4442
Assert.notNull(configs, "Configuration map cannot be null");
4543
this.configs = new HashMap<>(configs);
46-
// Not lambdas so we retain type information
47-
this.conversionService.addConverter(new Converter<Class<?>, String>() {
48-
49-
@Override
50-
public String convert(Class<?> c) {
51-
return c.getName();
52-
}
53-
54-
});
55-
this.conversionService.addConverter(new Converter<List<?>, String>() {
56-
57-
@Override
58-
public String convert(List<?> l) {
59-
String value = l.toString();
60-
// trim [...] - revert to comma-delimited list
61-
return value.substring(1, value.length() - 1);
62-
}
63-
64-
});
6544
}
6645

6746
/**

0 commit comments

Comments
 (0)