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 simple
SourceConnector
for testing that reliably produces the same records in the same order, and useful
for testing the infrastructure to run SourceConnector
s.
This connector produces messages with keys having a single monotonically-increasing integer field named id
:
{ "id" : "1" }and values with a
batch
field containing the 1-based batch number, a record
field containing the
1-based record number within the batch, and an optional timestamp
field that contains a simulated number of
milliseconds past epoch computed by adding the start time of the connector task with the message id
:
{ "batch" : "1", "record" : "1", "timestamp" : null }
- Author:
- Randall Hauch
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final boolean
static final int
static final String
static final String
static final String
static final String
static final String
protected static final String
Fields inherited from class org.apache.kafka.connect.connector.Connector
context
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.kafka.connect.source.SourceConnector
canDefineTransactionBoundaries, context, exactlyOnceSupport
Methods inherited from class org.apache.kafka.connect.connector.Connector
initialize, initialize, reconfigure, validate
-
Field Details
-
VERSION
- See Also:
-
TOPIC_NAME
- See Also:
-
RECORD_COUNT_PER_BATCH
- See Also:
-
BATCH_COUNT
- See Also:
-
DEFAULT_TOPIC_NAME
- See Also:
-
INCLUDE_TIMESTAMP
- See Also:
-
RETRIABLE_ERROR_ON
- See Also:
-
DEFAULT_RECORD_COUNT_PER_BATCH
public static final int DEFAULT_RECORD_COUNT_PER_BATCH- See Also:
-
DEFAULT_BATCH_COUNT
public static final int DEFAULT_BATCH_COUNT- See Also:
-
DEFAULT_INCLUDE_TIMESTAMP
public static final boolean DEFAULT_INCLUDE_TIMESTAMP- See Also:
-
config
-
-
Constructor Details
-
SimpleSourceConnector
public SimpleSourceConnector()
-
-
Method Details
-
version
-
start
- Specified by:
start
in classorg.apache.kafka.connect.connector.Connector
-
taskClass
- Specified by:
taskClass
in classorg.apache.kafka.connect.connector.Connector
-
taskConfigs
- 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
-