private void process(final ShareAcknowledgeOnCloseEvent event) {
        if (!requestManagers.shareConsumeRequestManager.isPresent()) {
            KafkaException error = new KafkaException("Group membership manager not present when processing an acknowledge-on-close event");
            event.future().completeExceptionally(error);
            return;
        }

        ShareConsumeRequestManager manager = requestManagers.shareConsumeRequestManager.get();
        CompletableFuture<Void> future = manager.acknowledgeOnClose(event.acknowledgementsMap(), event.deadlineMs());
        future.whenComplete(complete(event.future()));
    }
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