Class KafkaConsumerFactory
java.lang.Object
io.micronaut.configuration.kafka.KafkaConsumerFactory
A factory class for creating Kafka
Consumer instances.
The consumers are created by the ConsumerFactory bean.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.KafkaConsumerFactory(ConsumerFactory consumerFactory) Creates the factory. -
Method Summary
Modifier and TypeMethodDescription<K,V> Consumer <K, V> createConsumer(AbstractKafkaConsumerConfiguration<K, V> consumerConfiguration) Creates a newConsumerfor the given configuration with theConsumerFactory.
-
Constructor Details
-
KafkaConsumerFactory
Deprecated, for removal: This API element is subject to removal in a future version.UseKafkaConsumerFactory(ConsumerFactory)instead.Creates the factory with theDefaultConsumerFactory. -
KafkaConsumerFactory
Creates the factory.- Parameters:
consumerFactory- The consumer factory that creates the Kafka consumers- Since:
- 6.3.0
-
-
Method Details
-
createConsumer
@Prototype public <K,V> Consumer<K,V> createConsumer(@Parameter AbstractKafkaConsumerConfiguration<K, V> consumerConfiguration) Creates a newConsumerfor the given configuration with theConsumerFactory.- Type Parameters:
K- The key typeV- The value type- Parameters:
consumerConfiguration- The consumer configuration- Returns:
- The consumer
-
KafkaConsumerFactory(ConsumerFactory)instead.