From: Kai Moritz Date: Tue, 31 May 2022 04:02:06 +0000 (+0200) Subject: Für den Nachrichten-Schlüssel wird `.trim()` aufgerufen X-Git-Tag: bytestream-producer~10 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=425e089e078c1a25093d0cefe7bb3bef8347287c;p=demos%2Fkafka%2Ftraining Für den Nachrichten-Schlüssel wird `.trim()` aufgerufen --- diff --git a/src/main/java/de/juplo/kafka/RestProducer.java b/src/main/java/de/juplo/kafka/RestProducer.java index 6c852ce..0ecd667 100644 --- a/src/main/java/de/juplo/kafka/RestProducer.java +++ b/src/main/java/de/juplo/kafka/RestProducer.java @@ -52,6 +52,7 @@ public class RestProducer @PathVariable String key, @RequestBody String value) { + key = key.trim(); final ProducerRecord record = new ProducerRecord<>( topic, // Topic key, // Key @@ -65,6 +66,7 @@ public class RestProducer public DeferredResult greeting( @RequestBody String name) { + name = name.trim(); final ProducerRecord record = new ProducerRecord<>( topic, // Topic name, // Key