From: Kai Moritz Date: Mon, 12 Jun 2023 18:48:27 +0000 (+0200) Subject: Implementierung zum Anfügen der Header wiederhergestellt X-Git-Tag: producer/rest-producer---2023-06-signal~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=7582477ebe3527b6b09ae930d6411d389b7567d5;p=demos%2Fkafka%2Ftraining Implementierung zum Anfügen der Header wiederhergestellt --- diff --git a/src/main/java/de/juplo/kafka/RestProducer.java b/src/main/java/de/juplo/kafka/RestProducer.java index 73bec5b..cecb980 100644 --- a/src/main/java/de/juplo/kafka/RestProducer.java +++ b/src/main/java/de/juplo/kafka/RestProducer.java @@ -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();