From: Kai Moritz Date: Sun, 12 Jul 2020 12:24:43 +0000 (+0200) Subject: WIP X-Git-Tag: wip-initial~10 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0ee5ee46964d25025f73b34836ccd496d171ca39;p=demos%2Fspring%2Fdata-jdbc WIP --- 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 index ca228e0..0000000 --- a/src/main/java/de/trion/kafka/outbox/Event.java +++ /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; -} 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/UserEvent.java b/src/main/java/de/trion/kafka/outbox/UserEvent.java new file mode 100644 index 0000000..d22106c --- /dev/null +++ b/src/main/java/de/trion/kafka/outbox/UserEvent.java @@ -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 index 0000000..821da09 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1 @@ +management.endpoints.web.exposure.include=*