Class KafkaConnectUtils


  • public class KafkaConnectUtils
    extends Object
    • Method Detail

      • waitForConnectStatus

        public static void waitForConnectStatus​(String clusterName,
                                                Enum<?> status)
        Wait until the given Kafka Connect is in desired state.
        Parameters:
        clusterName - name of KafkaConnect cluster
        status - desired state
      • waitForConnectReady

        public static void waitForConnectReady​(String clusterName)
      • waitForConnectNotReady

        public static void waitForConnectNotReady​(String clusterName)
      • waitUntilKafkaConnectRestApiIsAvailable

        public static void waitUntilKafkaConnectRestApiIsAvailable​(String podNamePrefix)
      • waitForMessagesInKafkaConnectFileSink

        public static void waitForMessagesInKafkaConnectFileSink​(String kafkaConnectPodName,
                                                                 String sinkFileName,
                                                                 String message)
      • waitForMessagesInKafkaConnectFileSink

        public static void waitForMessagesInKafkaConnectFileSink​(String kafkaConnectPodName,
                                                                 String sinkFileName)
      • waitForKafkaConnectConfigChange

        public static void waitForKafkaConnectConfigChange​(String propertyKey,
                                                           String propertyValue,
                                                           String namespace,
                                                           String clusterName)
        Waits until the kafka connect CR config has changed.
        Parameters:
        propertyKey - property key in the Kafka Connect CR config
        propertyValue - property value in the Kafka Connect CR config
        namespace - namespace name
        clusterName - cluster name
      • waitForKafkaConnectCondition

        public static void waitForKafkaConnectCondition​(String conditionReason,
                                                        String conditionType,
                                                        String namespace,
                                                        String clusterName)
        Wait for designated Kafka Connect resource condition type and reason to happen.
        Parameters:
        conditionReason - String regexp of condition reason
        conditionType - String regexp of condition type
        namespace - namespace name
        clusterName - cluster name
      • waitUntilKafkaConnectStatusConditionContainsMessage

        public static void waitUntilKafkaConnectStatusConditionContainsMessage​(String clusterName,
                                                                               String namespace,
                                                                               String message)
      • sendReceiveMessagesThroughConnect

        public static void sendReceiveMessagesThroughConnect​(String connectPodName,
                                                             String topicName,
                                                             String kafkaClientsPodName,
                                                             String namespace,
                                                             String clusterName)
        Send and receive messages through file sink connector (using Kafka Connect).
        Parameters:
        connectPodName - kafkaConnect pod name
        topicName - topic to be used
        kafkaClientsPodName - kafkaClients pod name
        namespace - namespace name
        clusterName - cluster name