From c3668d0d15f9c91fa3dcdd75fde5019363c9caff Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 25 Jul 2022 17:58:28 +0200 Subject: [PATCH] =?utf8?q?Sp=C3=A4ter=20ben=C3=B6tigten=20Header=20zum=20P?= =?utf8?q?ostmapping=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/de/juplo/kafka/RestProducer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/juplo/kafka/RestProducer.java b/src/main/java/de/juplo/kafka/RestProducer.java index 7d9bf12..bfea3ca 100644 --- a/src/main/java/de/juplo/kafka/RestProducer.java +++ b/src/main/java/de/juplo/kafka/RestProducer.java @@ -5,14 +5,12 @@ import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringSerializer; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; import javax.annotation.PreDestroy; import java.util.Properties; import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; @Slf4j @@ -48,6 +46,7 @@ public class RestProducer @PostMapping(path = "{key}") public DeferredResult send( @PathVariable String key, + @RequestHeader(name = "X-id", required = false) Long correlationId, @RequestBody String value) { DeferredResult result = new DeferredResult<>(); -- 2.20.1