recorder: 1.2.0 - The key is also serialized as JSON (new type `User`)
[demos/kafka/wordcount] / src / main / java / de / juplo / kafka / wordcount / recorder / RecorderApplication.java
index 3928f2f..6702a70 100644 (file)
@@ -2,7 +2,6 @@ package de.juplo.kafka.wordcount.recorder;
 
 import org.apache.kafka.clients.producer.KafkaProducer;
 import org.apache.kafka.clients.producer.ProducerConfig;
-import org.apache.kafka.common.serialization.StringSerializer;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -24,7 +23,7 @@ public class RecorderApplication
 
                Properties props = new Properties();
                props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, properties.getBootstrapServer());
-               props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
+               props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
                props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
                props.put(JsonSerializer.ADD_TYPE_INFO_HEADERS, false);