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 80b40e9b..1d98ac6a 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 @@ -53,6 +53,7 @@ class KafkaProducerRecordBuilder { */ Future>> buildRecordsAsync(String topic, Buffer payload) { return Future.succeededFuture().compose((Void v) -> vertx.executeBlocking(() -> { + long beginEpchMs = currentTimeMillis(); JsonObject payloadObj; try { payloadObj = new JsonObject(payload); @@ -68,13 +69,12 @@ Future>> buildRecordsAsync(String topic if (recordsArray == null) { throw new ValidationException("Missing 'records' array"); } - long beginEpchMs = currentTimeMillis(); List> kafkaProducerRecords = new ArrayList<>(recordsArray.size()); for (int i = 0; i < recordsArray.size(); i++) { kafkaProducerRecords.add(fromRecordJsonObject(topic, recordsArray.getJsonObject(i))); } long durationMs = currentTimeMillis() - beginEpchMs; - log.debug("Serializing JSON did block thread for {}ms", durationMs); + log.debug("Parsing and Serializing JSON did block thread for {}ms", durationMs); return kafkaProducerRecords; })); }