Interface ConsumerAware<K,V>

Type Parameters:
K - The key type
V - 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 Type
    Method
    Description
    void
    setKafkaConsumer(@NonNull Consumer<K,V> consumer)
    Called when the underlying Consumer is created.
  • Method Details

    • setKafkaConsumer

      void setKafkaConsumer(@NonNull @NonNull Consumer<K,V> consumer)
      Called when the underlying Consumer is created.
      Parameters:
      consumer - The consumer