WIP
authorKai Moritz <kai@juplo.de>
Sun, 12 Jul 2020 12:24:43 +0000 (14:24 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 12 Jul 2020 12:24:43 +0000 (14:24 +0200)
src/main/java/de/trion/kafka/outbox/Event.java [deleted file]
src/main/java/de/trion/kafka/outbox/OutboxProducer.java
src/main/java/de/trion/kafka/outbox/UserEvent.java [new file with mode: 0644]
src/main/resources/application.properties [new file with mode: 0644]

diff --git a/src/main/java/de/trion/kafka/outbox/Event.java b/src/main/java/de/trion/kafka/outbox/Event.java
deleted file mode 100644 (file)
index ca228e0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package de.trion.kafka.outbox;
-
-public class Event {
-    public enum Type { CREATED, LOGIN, LOGOUT, DELETED }
-
-    Long id;
-    Type type;
-    String user;
-}
index 99adae9..d493aee 100644 (file)
@@ -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<String, String> record = new ProducerRecord<>(topic, event.user, json);
diff --git a/src/main/java/de/trion/kafka/outbox/UserEvent.java b/src/main/java/de/trion/kafka/outbox/UserEvent.java
new file mode 100644 (file)
index 0000000..d22106c
--- /dev/null
@@ -0,0 +1,9 @@
+package de.trion.kafka.outbox;
+
+public class UserEvent {
+    public enum Type { CREATED, LOGIN, LOGOUT, DELETED }
+
+    Long id;
+    Type type;
+    String user;
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
new file mode 100644 (file)
index 0000000..821da09
--- /dev/null
@@ -0,0 +1 @@
+management.endpoints.web.exposure.include=*