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 TypeMethodDescriptionvoid
setKafkaConsumer
(@NonNull Consumer<K, V> consumer) Called when the underlyingConsumer
is created.
-
Method Details
-
setKafkaConsumer
Called when the underlyingConsumer
is created.- Parameters:
consumer
- The consumer
-