From 090e5a0621ac26443e5c7c38678e4ff7ae2033e0 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 2 Apr 2022 23:15:04 +0200 Subject: [PATCH] Vorlage --- .../java/de/juplo/kafka/RestProducer.java | 46 ++----------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/src/main/java/de/juplo/kafka/RestProducer.java b/src/main/java/de/juplo/kafka/RestProducer.java index 19f70ba..d2e5712 100644 --- a/src/main/java/de/juplo/kafka/RestProducer.java +++ b/src/main/java/de/juplo/kafka/RestProducer.java @@ -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; } -- 2.20.1