package de.juplo.kafka.wordcount.top10;
-import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.streams.StreamsConfig;
props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, JsonSerde.class.getName());
props.put(JsonSerializer.ADD_TYPE_INFO_HEADERS, false);
props.put(JsonDeserializer.TRUSTED_PACKAGES, Top10Application.class.getPackageName());
- props.put(JsonDeserializer.KEY_DEFAULT_TYPE, Word.class.getName());
- props.put(JsonDeserializer.VALUE_DEFAULT_TYPE, WordCount.class.getName());
+ props.put(JsonDeserializer.KEY_DEFAULT_TYPE, Key.class.getName());
+ props.put(JsonDeserializer.VALUE_DEFAULT_TYPE, Counter.class.getName());
props.put(JsonDeserializer.USE_TYPE_INFO_HEADERS, false);
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
@Bean(initMethod = "start", destroyMethod = "stop")
public Top10StreamProcessor streamProcessor(
Top10ApplicationProperties applicationProperties,
- ObjectMapper objectMapper,
Properties streamProcessorProperties,
ConfigurableApplicationContext context)
{
Top10StreamProcessor streamProcessor = new Top10StreamProcessor(
applicationProperties.getInputTopic(),
applicationProperties.getOutputTopic(),
- objectMapper,
streamProcessorProperties);
streamProcessor.streams.setUncaughtExceptionHandler((Throwable e) ->