Class MockConnector

java.lang.Object
org.apache.kafka.connect.connector.Connector
org.apache.kafka.connect.tools.MockConnector
All Implemented Interfaces:
org.apache.kafka.connect.components.Versioned

public class MockConnector extends org.apache.kafka.connect.connector.Connector
This connector provides support for mocking certain connector behaviors. For example, this can be used to simulate connector or task failures. It works by passing a "mock mode" through configuration from the system test. New mock behavior can be implemented either in the connector or in the task by providing a new mode implementation.

At the moment, this connector only supports a single task and shares configuration between the connector and its tasks.

See Also:
  • Field Details

  • Constructor Details

    • MockConnector

      public MockConnector()
  • Method Details

    • version

      public String version()
    • start

      public void start(Map<String,String> config)
      Specified by:
      start in class org.apache.kafka.connect.connector.Connector
    • taskClass

      public Class<? extends org.apache.kafka.connect.connector.Task> taskClass()
      Specified by:
      taskClass in class org.apache.kafka.connect.connector.Connector
    • taskConfigs

      public List<Map<String,String>> taskConfigs(int maxTasks)
      Specified by:
      taskConfigs in class org.apache.kafka.connect.connector.Connector
    • stop

      public void stop()
      Specified by:
      stop in class org.apache.kafka.connect.connector.Connector
    • config

      public org.apache.kafka.common.config.ConfigDef config()
      Specified by:
      config in class org.apache.kafka.connect.connector.Connector