From 476d3ff3659a2c9255f2e0a8bac383bf1c8f7709 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 15 Jun 2023 22:54:54 +0200 Subject: [PATCH] =?utf8?q?Implementierung=20des=20Versands=20der=20Header?= =?utf8?q?=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/de/juplo/kafka/RestProducer.java | 6 ++++++ 1 file changed, 6 insertions(+) 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(); -- 2.20.1