Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed May 13, 2024
1 parent cb9007b commit 0eb3c04
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ private void startProducer() {
State stateTransient = state;
log.info("[{}] Closing the new producer because the synchronizer state is {}", prod,
stateTransient);
CompletableFuture closeProducer = new CompletableFuture<>();
closeResource(() -> prod.closeAsync(), closeProducer);
CompletableFuture<Void> closeProducer = new CompletableFuture<>();
closeResource(prod::closeAsync, closeProducer);
closeProducer.thenRun(() -> {
log.info("[{}] Closed the new producer because the synchronizer state is {}", prod,
stateTransient);
Expand Down Expand Up @@ -221,11 +221,13 @@ private void startConsumer() {
log.info("successfully created consumer {}", topicName);
} else {
State stateTransient = state;
log.info("[{}] Closing the new consumer because the synchronizer state is {}", stateTransient);
CompletableFuture closeConsumer = new CompletableFuture<>();
closeResource(() -> consumer.closeAsync(), closeConsumer);
log.info("[{}] Closing the new consumer because the synchronizer state is {}", topicName,
stateTransient);
CompletableFuture<Void> closeConsumer = new CompletableFuture<>();
closeResource(consumer::closeAsync, closeConsumer);
closeConsumer.thenRun(() -> {
log.info("[{}] Closed the new consumer because the synchronizer state is {}", stateTransient);
log.info("[{}] Closed the new consumer because the synchronizer state is {}", topicName,
stateTransient);
});
}
}).exceptionally(ex -> {
Expand Down

0 comments on commit 0eb3c04

Please sign in to comment.