Moved the name of the header for the sequence-number into a static field
authorKai Moritz <kai@juplo.de>
Sun, 31 Jan 2021 15:51:59 +0000 (16:51 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 31 Jan 2021 15:51:59 +0000 (16:51 +0100)
delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java

index 165e8e2..29d827a 100644 (file)
@@ -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<String, String> 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) ->
     {