Class KafkaUtils


  • public final class KafkaUtils
    extends java.lang.Object
    Utility methods.
    Since:
    2.2
    Author:
    Gary Russell
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean MICROMETER_PRESENT
      True if micrometer is on the class path.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearConsumerGroupId()
      Clear the group id for the consumer bound to this thread.
      static java.lang.String getConsumerGroupId()
      Get the group id for the consumer bound to this thread.
      static boolean returnTypeMessageOrCollectionOf​(java.lang.reflect.Method method)
      Return true if the method return type is Message or Collection<Message<?>>.
      static void setConsumerGroupId​(java.lang.String groupId)
      Set the group id for the consumer bound to this thread.
      • Methods inherited from class java.lang.Object

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

      • MICROMETER_PRESENT

        public static final boolean MICROMETER_PRESENT
        True if micrometer is on the class path.
    • Method Detail

      • returnTypeMessageOrCollectionOf

        public static boolean returnTypeMessageOrCollectionOf​(java.lang.reflect.Method method)
        Return true if the method return type is Message or Collection<Message<?>>.
        Parameters:
        method - the method.
        Returns:
        true if it returns message(s).
      • setConsumerGroupId

        public static void setConsumerGroupId​(java.lang.String groupId)
        Set the group id for the consumer bound to this thread.
        Parameters:
        groupId - the group id.
        Since:
        2.3
      • getConsumerGroupId

        public static java.lang.String getConsumerGroupId()
        Get the group id for the consumer bound to this thread.
        Returns:
        the group id.
        Since:
        2.3
      • clearConsumerGroupId

        public static void clearConsumerGroupId()
        Clear the group id for the consumer bound to this thread.
        Since:
        2.3