Package io.micronaut.configuration.kafka
Interface ConsumerAware<K,V>
- Type Parameters:
K- The key typeV- The value type
public interface ConsumerAware<K,V>
Interface for
KafkaListener instances to implement
if they wish to obtain a reference to the underlying Consumer.
Modification of received Consumer instances (e.g. modifying subscriptions) is possible ONLY
when run by the Thread driving KafkaConsumer's poll loop! Otherwise you will receive ConcurrentModificationException, cause KafkaConsumer instances are not safe for
multi-threaded access!
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionvoidsetKafkaConsumer(Consumer<K, V> consumer) Called when the underlyingConsumeris created.
-
Method Details
-
setKafkaConsumer
Called when the underlyingConsumeris created.- Parameters:
consumer- The consumer
-