From: Kai Moritz Date: Mon, 25 Jul 2022 15:58:28 +0000 (+0200) Subject: Später benötigten Header zum Postmapping hinzugefügt X-Git-Tag: customized---lvm-2-tage^2~3 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c3668d0d15f9c91fa3dcdd75fde5019363c9caff;p=demos%2Fkafka%2Ftraining Später benötigten Header zum Postmapping hinzugefügt --- 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<>();