Implementierung zum Anfügen der Header wiederhergestellt
authorKai Moritz <kai@juplo.de>
Mon, 12 Jun 2023 18:48:27 +0000 (20:48 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 17 Oct 2023 22:20:13 +0000 (00:20 +0200)
src/main/java/de/juplo/kafka/RestProducer.java

index 73bec5b..cecb980 100644 (file)
@@ -42,6 +42,12 @@ public class RestProducer
         value   // Value
     );
 
+    record.headers().add("source", id.getBytes());
+    if (correlationId != null)
+    {
+      record.headers().add("id", BigInteger.valueOf(correlationId).toByteArray());
+    }
+
     producer.send(record, (metadata, e) ->
     {
       long now = System.currentTimeMillis();