private <T> BiConsumer<? super T, ? super Throwable> complete(final CompletableFuture<T> b) {
        return (value, exception) -> {
            if (exception != null)
                b.completeExceptionally(exception);
            else
                b.complete(value);
        };
    }
Process event indicating that the consumer is closing. This will make the consumer
complete pending acknowledgements.

@param event Acknowledge-on-close event containing a future that will complete when
             the acknowledgements have responses.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java