From 0ee5ee46964d25025f73b34836ccd496d171ca39 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 12 Jul 2020 14:24:43 +0200 Subject: [PATCH] WIP --- src/main/java/de/trion/kafka/outbox/OutboxProducer.java | 3 +-- .../java/de/trion/kafka/outbox/{Event.java => UserEvent.java} | 2 +- src/main/resources/application.properties | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) rename src/main/java/de/trion/kafka/outbox/{Event.java => UserEvent.java} (84%) create mode 100644 src/main/resources/application.properties diff --git a/src/main/java/de/trion/kafka/outbox/OutboxProducer.java b/src/main/java/de/trion/kafka/outbox/OutboxProducer.java index 99adae9..d493aee 100644 --- a/src/main/java/de/trion/kafka/outbox/OutboxProducer.java +++ b/src/main/java/de/trion/kafka/outbox/OutboxProducer.java @@ -3,7 +3,6 @@ package de.trion.kafka.outbox; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; -import org.apache.kafka.common.serialization.LongSerializer; import org.apache.kafka.common.serialization.StringSerializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,7 +34,7 @@ public class OutboxProducer { } - public void send(Event event) { + public void send(UserEvent event) { try { String json = mapper.writeValueAsString(event); ProducerRecord record = new ProducerRecord<>(topic, event.user, json); diff --git a/src/main/java/de/trion/kafka/outbox/Event.java b/src/main/java/de/trion/kafka/outbox/UserEvent.java similarity index 84% rename from src/main/java/de/trion/kafka/outbox/Event.java rename to src/main/java/de/trion/kafka/outbox/UserEvent.java index ca228e0..d22106c 100644 --- a/src/main/java/de/trion/kafka/outbox/Event.java +++ b/src/main/java/de/trion/kafka/outbox/UserEvent.java @@ -1,6 +1,6 @@ package de.trion.kafka.outbox; -public class Event { +public class UserEvent { public enum Type { CREATED, LOGIN, LOGOUT, DELETED } Long id; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..821da09 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1 @@ +management.endpoints.web.exposure.include=* -- 2.20.1