public void onAcknowledgement(RecordMetadata metadata, Exception exception) {
        for (ProducerInterceptor<K, V> interceptor : this.interceptors) {
            try {
                interceptor.onAcknowledgement(metadata, exception);
            } catch (Exception e) {
                // do not propagate interceptor exceptions, just log
                log.warn("Error executing interceptor onAcknowledgement callback", e);
            }
        }
    }
This method is called when the record sent to the server has been acknowledged, or when sending the record fails before
it gets sent to the server. This method calls {@link ProducerInterceptor#onAcknowledgement(RecordMetadata, Exception)}
method for each interceptor.

This method does not throw exceptions. Exceptions thrown by any of interceptor methods are caught and ignored.

@param metadata The metadata for the record that was sent (i.e. the partition and offset).
                If an error occurred, metadata will only contain valid topic and maybe partition.
@param exception The exception thrown during processing of this record. Null if no error occurred.
clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerInterceptors.java