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-1~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=011cbe16670610f9fb4f301abd49ae082fa9787b;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 165e8e2..29d827a 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; @@ -87,7 +88,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) -> {