Vorlage
authorKai Moritz <kai@juplo.de>
Sat, 2 Apr 2022 21:15:04 +0000 (23:15 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 2 Apr 2022 21:59:08 +0000 (23:59 +0200)
src/main/java/de/juplo/kafka/RestProducer.java

index 19f70ba..d2e5712 100644 (file)
@@ -57,48 +57,10 @@ public class RestProducer
         value   // Value
     );
 
-    producer.send(record, (metadata, e) ->
-    {
-      long now = System.currentTimeMillis();
-      if (e == null)
-      {
-        // HANDLE SUCCESS
-        produced++;
-        result.setResult(new ProduceSuccess(metadata.partition(), metadata.offset()));
-        log.debug(
-            "{} - Sent key={} message={} partition={}/{} timestamp={} latency={}ms",
-            id,
-            record.key(),
-            record.value(),
-            metadata.partition(),
-            metadata.offset(),
-            metadata.timestamp(),
-            now - time
-        );
-      }
-      else
-      {
-        // HANDLE ERROR
-        result.setErrorResult(new ProduceFailure(e));
-        log.error(
-            "{} - ERROR key={} timestamp={} latency={}ms: {}",
-            id,
-            record.key(),
-            metadata == null ? -1 : metadata.timestamp(),
-            now - time,
-            e.toString()
-        );
-      }
-    });
-
-    long now = System.currentTimeMillis();
-    log.trace(
-        "{} - Queued #{} key={} latency={}ms",
-        id,
-        value,
-        record.key(),
-        now - time
-    );
+    // TODO: Nachricht versenden und Feedback geben
+    // Tipp:
+    // result.setResult(new ProduceSuccess(metadata.partition(), metadata.offset()));
+    // result.setErrorResult(new ProduceFailure(e));
 
     return result;
   }