Skip to content

Commit

Permalink
[SDCISA-16207, #583] Bring back ugly code again, as cleanup breaks te…
Browse files Browse the repository at this point in the history
…sts for whatever reason.
  • Loading branch information
hiddenalpha committed Jun 17, 2024
1 parent 5a8f462 commit fb718a4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.List;

import static java.lang.System.currentTimeMillis;
import static java.lang.Thread.currentThread;
import static org.slf4j.LoggerFactory.getLogger;

/**
Expand Down Expand Up @@ -52,7 +51,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 vertx.executeBlocking(() -> {
return Future.<Void>succeededFuture().compose((Void v) -> vertx.executeBlocking(() -> {
long beginEpchMs = currentTimeMillis();
JsonObject payloadObj;
try {
Expand All @@ -76,7 +75,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 fb718a4

Please sign in to comment.