Class AbstractKafkaProducerConfiguration<K,V>

java.lang.Object
io.micronaut.configuration.kafka.config.AbstractKafkaConfiguration<K,V>
io.micronaut.configuration.kafka.config.AbstractKafkaProducerConfiguration<K,V>
Type Parameters:
K - The key deserializer type
V - The value deserializer type
All Implemented Interfaces:
io.micronaut.core.util.Toggleable
Direct Known Subclasses:
DefaultKafkaProducerConfiguration, KafkaProducerConfiguration

public abstract class AbstractKafkaProducerConfiguration<K,V> extends AbstractKafkaConfiguration<K,V>
Abstract Configuration for Apache Kafka Producer. See https://kafka.apache.org/documentation.html#producerconfigs
Since:
1.0
Author:
Iván López, Graeme Rocher
  • Constructor Details

    • AbstractKafkaProducerConfiguration

      protected AbstractKafkaProducerConfiguration(Properties config)
      Constructs a new instance.
      Parameters:
      config - The config to use
  • Method Details

    • getKeySerializer

      public Optional<Serializer<K>> getKeySerializer()
      Returns:
      The default key Serializer
    • setKeySerializer

      public void setKeySerializer(@Nullable @Nullable Serializer<K> keySerializer)
      Sets the key serializer.
      Parameters:
      keySerializer - The key serializer
    • getValueSerializer

      public Optional<Serializer<V>> getValueSerializer()
      Returns:
      The default value Serializer
    • setValueSerializer

      public void setValueSerializer(@Nullable @Nullable Serializer<V> valueSerializer)
      Sets the default value serializer.
      Parameters:
      valueSerializer - The value serializer