From: Kai Moritz Date: Sun, 31 Jan 2021 15:51:59 +0000 (+0100) Subject: Moved the name of the header for the sequence-number into a static field X-Git-Tag: part-2~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0f0d035e62ec8035809108c2881065d24ca1b62d;p=demos%2Fkafka%2Foutbox Moved the name of the header for the sequence-number into a static field --- diff --git a/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java b/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java index 09c8789..2ad4b7e 100644 --- a/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java +++ b/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java @@ -25,6 +25,7 @@ public class OutboxProducer { final static Logger LOG = LoggerFactory.getLogger(OutboxProducer.class); + public final static String HEADER = "#"; private final OutboxRepository repository; private final KafkaProducer producer; @@ -68,7 +69,7 @@ public class OutboxProducer new ProducerRecord<>(topic, item.getKey(), item.getValue()); sequenceNumber = item.getSequenceNumber(); - record.headers().add("SEQ#", Longs.toByteArray(sequenceNumber)); + record.headers().add(HEADER, Longs.toByteArray(sequenceNumber)); producer.send(record, (metadata, e) -> {