Class KafkaHelper


  • public class KafkaHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      java.lang.String
      getClientId​(org.apache.kafka.clients.consumer.KafkaConsumer<K,​V> consumer)  
      static <K,​V>
      java.lang.String
      getClientId​(org.apache.kafka.clients.producer.Producer<K,​V> producer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getClientId

        public static <K,​V> java.lang.String getClientId​(org.apache.kafka.clients.consumer.KafkaConsumer<K,​V> consumer)
        Type Parameters:
        K - the type of the Key
        V - the type of the Value
        Parameters:
        consumer - the Kafka consumer
        Returns:
        the name of the consumer as used in log messages that is hidden within the metrics
      • getClientId

        public static <K,​V> java.lang.String getClientId​(org.apache.kafka.clients.producer.Producer<K,​V> producer)
        Type Parameters:
        K - the type of the Key
        V - the type of the Value
        Parameters:
        producer - the Kafka producer
        Returns:
        the name of the producer as used in log messages that is hidden within the metrics