Class DefaultProducerFactory

java.lang.Object
io.micronaut.configuration.kafka.DefaultProducerFactory
All Implemented Interfaces:
ProducerFactory

@Factory public class DefaultProducerFactory extends Object implements ProducerFactory
A default implementation of ProducerFactory used for creating producer.
Since:
5.0.0
Author:
milanspre
  • Constructor Details

    • DefaultProducerFactory

      public DefaultProducerFactory()
  • Method Details

    • createProducer

      @NonNull public <K, V> @NonNull Producer<K,V> createProducer(Properties config, Serializer<K> ks, Serializer<V> vs)
      Creates kafka producer, could be overridden for further control.
      Specified by:
      createProducer in interface ProducerFactory
      Type Parameters:
      K - key type
      V - value type
      Parameters:
      config - properties for producer
      ks - key serializer
      vs - value serializer
      Returns:
      new instance of producer
      Since:
      5.0.0