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)}. */