Skip to content

Commit

Permalink
fix(emulator): formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jeqo committed Jul 21, 2022
1 parent a70b169 commit 5ffd6cb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions emulator/src/main/java/kafka/cli/emulator/KafkaEmulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,30 @@ public void replay(
for (var r : rs) {
// prepare record
final var topicName = topicMap.getOrDefault(r.topic(), r.topic());
var record = new ProducerRecord<>(topicName, r.partition(), prevTime + r.afterMs(), r.key(), r.value());
var record = new ProducerRecord<>(
topicName,
r.partition(),
prevTime + r.afterMs(),
r.key(),
r.value()
);
try {
// wait
var wait = (prevTime + r.afterMs()) - System.currentTimeMillis();
if (!noWait && wait > 0) {
LOG.info("{}:{}:{}: waiting {} ms.", topicName, r.partition(), r.offset(), r.afterMs());
LOG.info(
"{}:{}:{}: waiting {} ms.",
topicName,
r.partition(),
r.offset(),
r.afterMs()
);
Thread.sleep(r.afterMs());
} else {
LOG.info(
"{}:{}:{}: no waiting (expected after: {} ms.)",
topicName, r.partition(),
topicName,
r.partition(),
r.offset(),
r.afterMs()
);
Expand Down

0 comments on commit 5ffd6cb

Please sign in to comment.