Skip to content

Commit

Permalink
[SDCISA-16207, swisspost#583] Remove unneccessary Future.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenalpha committed Jun 17, 2024
1 parent e2f576b commit 5a8f462
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class KafkaProducerRecordBuilder {
* @throws ValidationException when the payload is not valid (missing properties, wrong types, etc.)
*/
Future<List<KafkaProducerRecord<String, String>>> buildRecordsAsync(String topic, Buffer payload) {
return Future.<Void>succeededFuture().compose((Void v) -> vertx.executeBlocking(() -> {
return vertx.executeBlocking(() -> {
long beginEpchMs = currentTimeMillis();
JsonObject payloadObj;
try {
Expand All @@ -76,7 +76,7 @@ Future<List<KafkaProducerRecord<String, String>>> 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)}. */
Expand Down

0 comments on commit 5a8f462

Please sign in to comment.