From: Kai Moritz Date: Thu, 15 Jun 2023 20:54:54 +0000 (+0200) Subject: Implementierung des Versands der Header ergänzt X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=476d3ff3659a2c9255f2e0a8bac383bf1c8f7709;p=demos%2Fkafka%2Ftraining Implementierung des Versands der Header ergänzt --- diff --git a/src/main/java/de/juplo/kafka/RestProducer.java b/src/main/java/de/juplo/kafka/RestProducer.java index 0158774..e68fe66 100644 --- a/src/main/java/de/juplo/kafka/RestProducer.java +++ b/src/main/java/de/juplo/kafka/RestProducer.java @@ -57,6 +57,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();