17
17
package org .springframework .kafka .config ;
18
18
19
19
import java .util .HashMap ;
20
- import java .util .List ;
21
20
import java .util .Map ;
22
21
import java .util .Properties ;
23
22
24
- import org .springframework .core .convert .converter .Converter ;
25
- import org .springframework .core .convert .support .DefaultConversionService ;
26
23
import org .springframework .util .Assert ;
27
24
28
25
/**
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.
30
30
*
31
31
* @author Gary Russell
32
32
* @since 2.2
@@ -36,32 +36,11 @@ public class KafkaStreamsConfiguration {
36
36
37
37
private final Map <String , Object > configs ;
38
38
39
- private final DefaultConversionService conversionService = new DefaultConversionService ();
40
-
41
39
private Properties properties ;
42
40
43
41
public KafkaStreamsConfiguration (Map <String , Object > configs ) {
44
42
Assert .notNull (configs , "Configuration map cannot be null" );
45
43
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
- });
65
44
}
66
45
67
46
/**
0 commit comments