Class CompositeProducerInterceptor<K,V>

java.lang.Object
org.springframework.kafka.support.CompositeProducerInterceptor<K,V>
Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.clients.producer.ProducerInterceptor<K,V>, org.apache.kafka.common.Configurable

public class CompositeProducerInterceptor<K,V> extends Object implements org.apache.kafka.clients.producer.ProducerInterceptor<K,V>, Closeable
A ProducerInterceptor that delegates to a collection of interceptors.
Since:
3.0
Author:
Soby Chacko
  • Constructor Details

    • CompositeProducerInterceptor

      @SafeVarargs public CompositeProducerInterceptor(org.apache.kafka.clients.producer.ProducerInterceptor<K,V>... delegates)
      Construct an instance with the provided delegates to ProducerInterceptors.
      Parameters:
      delegates - the delegates.
  • Method Details

    • onSend

      public org.apache.kafka.clients.producer.ProducerRecord<K,V> onSend(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
      Specified by:
      onSend in interface org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
    • onAcknowledgement

      public void onAcknowledgement(org.apache.kafka.clients.producer.RecordMetadata metadata, Exception exception)
      Specified by:
      onAcknowledgement in interface org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
    • configure

      public void configure(Map<String,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable