Für den Nachrichten-Schlüssel wird `.trim()` aufgerufen
authorKai Moritz <kai@juplo.de>
Tue, 31 May 2022 04:02:06 +0000 (06:02 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 12 Jun 2022 13:26:03 +0000 (15:26 +0200)
src/main/java/de/juplo/kafka/RestProducer.java

index 6c852ce..0ecd667 100644 (file)
@@ -52,6 +52,7 @@ public class RestProducer
       @PathVariable String key,
       @RequestBody String value)
   {
+    key = key.trim();
     final ProducerRecord<String, Object> record = new ProducerRecord<>(
         topic,  // Topic
         key,    // Key
@@ -65,6 +66,7 @@ public class RestProducer
   public DeferredResult<ProduceResult> greeting(
       @RequestBody String name)
   {
+    name = name.trim();
     final ProducerRecord<String, Object> record = new ProducerRecord<>(
         topic,  // Topic
         name,    // Key