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 Summary
Modifier and TypeMethodDescription<K,V> @NonNull Consumer <K, V> createConsumer(Properties config, @Nullable Deserializer<K> kd, @Nullable Deserializer<V> vd) Creates a Kafka consumer.
-
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 typeV- value type- Parameters:
config- properties for the consumerkd- key deserializer, ornullto configure it from the propertiesvd- value deserializer, ornullto configure it from the properties- Returns:
- new instance of consumer
-