Package io.debezium.connector.simple
Class SimpleSourceConnector
- java.lang.Object
-
- org.apache.kafka.connect.connector.Connector
-
- org.apache.kafka.connect.source.SourceConnector
-
- io.debezium.connector.simple.SimpleSourceConnector
-
- All Implemented Interfaces:
org.apache.kafka.connect.components.Versioned
public class SimpleSourceConnector extends org.apache.kafka.connect.source.SourceConnector
A very simpleSourceConnector
for testing that reliably produces the same records in the same order, and useful for testing the infrastructure to runSourceConnector
s.This connector produces messages with keys having a single monotonically-increasing integer field named
id
:{ "id" : "1" }
and values with abatch
field containing the 1-based batch number, arecord
field containing the 1-based record number within the batch, and an optionaltimestamp
field that contains a simulated number of milliseconds past epoch computed by adding the start time of the connector task with the messageid
:{ "batch" : "1", "record" : "1", "timestamp" : null }
- Author:
- Randall Hauch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleSourceConnector.SimpleConnectorTask
-
Field Summary
Fields Modifier and Type Field Description static String
BATCH_COUNT
private Map<String,String>
config
static int
DEFAULT_BATCH_COUNT
static boolean
DEFAULT_INCLUDE_TIMESTAMP
static int
DEFAULT_RECORD_COUNT_PER_BATCH
static String
DEFAULT_TOPIC_NAME
static String
INCLUDE_TIMESTAMP
static String
RECORD_COUNT_PER_BATCH
static String
RETRIABLE_ERROR_ON
static String
TOPIC_NAME
protected static String
VERSION
-
Constructor Summary
Constructors Constructor Description SimpleSourceConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kafka.common.config.ConfigDef
config()
void
start(Map<String,String> props)
void
stop()
Class<? extends org.apache.kafka.connect.connector.Task>
taskClass()
List<Map<String,String>>
taskConfigs(int maxTasks)
String
version()
-
-
-
Field Detail
-
VERSION
protected static final String VERSION
- See Also:
- Constant Field Values
-
TOPIC_NAME
public static final String TOPIC_NAME
- See Also:
- Constant Field Values
-
RECORD_COUNT_PER_BATCH
public static final String RECORD_COUNT_PER_BATCH
- See Also:
- Constant Field Values
-
BATCH_COUNT
public static final String BATCH_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_TOPIC_NAME
public static final String DEFAULT_TOPIC_NAME
- See Also:
- Constant Field Values
-
INCLUDE_TIMESTAMP
public static final String INCLUDE_TIMESTAMP
- See Also:
- Constant Field Values
-
RETRIABLE_ERROR_ON
public static final String RETRIABLE_ERROR_ON
- See Also:
- Constant Field Values
-
DEFAULT_RECORD_COUNT_PER_BATCH
public static final int DEFAULT_RECORD_COUNT_PER_BATCH
- See Also:
- Constant Field Values
-
DEFAULT_BATCH_COUNT
public static final int DEFAULT_BATCH_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_INCLUDE_TIMESTAMP
public static final boolean DEFAULT_INCLUDE_TIMESTAMP
- See Also:
- Constant Field Values
-
-
Method Detail
-
version
public String version()
-
start
public void start(Map<String,String> props)
- Specified by:
start
in classorg.apache.kafka.connect.connector.Connector
-
taskClass
public Class<? extends org.apache.kafka.connect.connector.Task> taskClass()
- Specified by:
taskClass
in classorg.apache.kafka.connect.connector.Connector
-
taskConfigs
public List<Map<String,String>> taskConfigs(int maxTasks)
- Specified by:
taskConfigs
in classorg.apache.kafka.connect.connector.Connector
-
stop
public void stop()
- Specified by:
stop
in classorg.apache.kafka.connect.connector.Connector
-
config
public org.apache.kafka.common.config.ConfigDef config()
- Specified by:
config
in classorg.apache.kafka.connect.connector.Connector
-
-