Verbesserungen des Testfalls gemerged (Branch 'deserialization')
authorKai Moritz <kai@juplo.de>
Tue, 26 Jul 2022 14:11:45 +0000 (16:11 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 26 Jul 2022 14:11:45 +0000 (16:11 +0200)
1  2 
src/main/java/de/juplo/kafka/ApplicationConfiguration.java
src/test/java/de/juplo/kafka/ApplicationTests.java

@@@ -58,13 -58,10 +58,14 @@@ public class ApplicationConfiguratio
      props.put("group.id", properties.getGroupId());
      props.put("client.id", properties.getClientId());
      props.put("auto.offset.reset", properties.getAutoOffsetReset());
+     props.put("auto.commit.interval.ms", (int)properties.getCommitInterval().toMillis());
      props.put("metadata.max.age.ms", "1000");
      props.put("key.deserializer", StringDeserializer.class.getName());
 -    props.put("value.deserializer", LongDeserializer.class.getName());
 +    props.put("value.deserializer", JsonDeserializer.class.getName());
 +    props.put(JsonDeserializer.TYPE_MAPPINGS,
 +        "message:" + ClientMessage.class.getName() + "," +
 +        "greeting:" + Greeting.class.getName());
 +    props.put(JsonDeserializer.TRUSTED_PACKAGES, "de.juplo.kafka");
  
      return new KafkaConsumer<>(props);
    }