Interface ConsumerFactory

All Known Implementing Classes:
DefaultConsumerFactory

public interface ConsumerFactory
Creates the Kafka Consumer instances used by Micronaut Kafka, including those of @KafkaListener beans. Replace DefaultConsumerFactory to use another implementation of the Kafka client API.
Since:
6.3.0
  • Method Details

    • createConsumer

      <K,V> @NonNull Consumer<K,V> createConsumer(Properties config, @Nullable Deserializer<K> kd, @Nullable Deserializer<V> vd)
      Creates a Kafka consumer.
      Type Parameters:
      K - key type
      V - value type
      Parameters:
      config - properties for the consumer
      kd - key deserializer, or null to configure it from the properties
      vd - value deserializer, or null to configure it from the properties
      Returns:
      new instance of consumer