From 5a8f4621e6520d5adcca8e9594217b79496406be Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:57:53 +0200 Subject: [PATCH] [SDCISA-16207, #583] Remove unneccessary Future. --- .../swisspush/gateleen/kafka/KafkaProducerRecordBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaProducerRecordBuilder.java b/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaProducerRecordBuilder.java index 1d98ac6a..8ab9e09f 100644 --- a/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaProducerRecordBuilder.java +++ b/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaProducerRecordBuilder.java @@ -52,7 +52,7 @@ class KafkaProducerRecordBuilder { * @throws ValidationException when the payload is not valid (missing properties, wrong types, etc.) */ Future>> buildRecordsAsync(String topic, Buffer payload) { - return Future.succeededFuture().compose((Void v) -> vertx.executeBlocking(() -> { + return vertx.executeBlocking(() -> { long beginEpchMs = currentTimeMillis(); JsonObject payloadObj; try { @@ -76,7 +76,7 @@ Future>> buildRecordsAsync(String topic long durationMs = currentTimeMillis() - beginEpchMs; log.debug("Parsing and Serializing JSON did block thread for {}ms", durationMs); return kafkaProducerRecords; - })); + }); } /** @deprecated Use {@link #buildRecordsAsync(String, Buffer)}. */