vert-x3 / vertx-kafka-client

Reactive Kafka Client for Vert.x
Apache License 2.0
84 stars 82 forks source link

Kafka Admin Client `close` does not report completion #192

Closed cescoffier closed 3 years ago

cescoffier commented 3 years ago
 @Override
  public Future<Void> close(long timeout) {
    ContextInternal ctx = (ContextInternal) vertx.getOrCreateContext();
    Promise<Void> promise = ctx.promise();

    ctx.executeBlocking(prom -> {
      if (timeout > 0) {
        adminClient.close(Duration.ofMillis(timeout));
      } else {
        adminClient.close();
      }
      prom.complete();
    });
    return promise.future();
  }

The executeBlocking to not report the completion on the right promise.

cescoffier commented 3 years ago

This is blocking the integration of Vert.x 4 in SmallRye Reactive Messaging and so Quarkus.

cescoffier commented 3 years ago

Also, it needs to handle failure (as close may fail in some rare situations).