|
25 | 25 |
|
26 | 26 | import org.apache.kafka.common.serialization.Serdes; |
27 | 27 | import org.apache.kafka.streams.KafkaStreams; |
| 28 | +import org.apache.kafka.streams.StreamsBuilder; |
28 | 29 | import org.apache.kafka.streams.StreamsConfig; |
29 | 30 | import org.apache.kafka.streams.kstream.KStream; |
30 | | -import org.apache.kafka.streams.kstream.KStreamBuilder; |
31 | 31 |
|
32 | 32 | /** |
33 | 33 | * @author Kai Waehner |
@@ -62,12 +62,13 @@ public static void main(String[] args) throws Exception { |
62 | 62 |
|
63 | 63 | // Specify default (de)serializers for record keys and for record |
64 | 64 | // values. |
65 | | -streamsConfiguration.put(StreamsConfig.KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName()); |
66 | | -streamsConfiguration.put(StreamsConfig.VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName()); |
| 65 | +streamsConfiguration.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName()); |
| 66 | +streamsConfiguration.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName()); |
67 | 67 |
|
68 | 68 | // In the subsequent lines we define the processing topology of the Streams |
69 | 69 | // application. |
70 | | -final KStreamBuilder builder = new KStreamBuilder(); |
| 70 | +// final KStreamBuilder builder = new KStreamBuilder(); |
| 71 | +final StreamsBuilder builder = new StreamsBuilder(); |
71 | 72 |
|
72 | 73 | // Construct a `KStream` from the input topic "ImageInputTopic", where |
73 | 74 | // message values represent lines of text |
@@ -108,7 +109,7 @@ public static void main(String[] args) throws Exception { |
108 | 109 |
|
109 | 110 | // Start Kafka Streams Application to process new incoming images from the Input |
110 | 111 | // Topic |
111 | | -final KafkaStreams streams = new KafkaStreams(builder, streamsConfiguration); |
| 112 | +final KafkaStreams streams = new KafkaStreams(builder.build(), streamsConfiguration); |
112 | 113 |
|
113 | 114 | streams.cleanUp(); |
114 | 115 |
|
|
0 commit comments