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 SourceConnectors.
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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final booleanstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final StringFields inherited from class org.apache.kafka.connect.connector.Connector
context -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.kafka.connect.source.SourceConnector
alterOffsets, canDefineTransactionBoundaries, context, exactlyOnceSupportMethods 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:
startin classorg.apache.kafka.connect.connector.Connector
-
taskClass
- Specified by:
taskClassin classorg.apache.kafka.connect.connector.Connector
-
taskConfigs
- Specified by:
taskConfigsin classorg.apache.kafka.connect.connector.Connector
-
stop
public void stop()- Specified by:
stopin classorg.apache.kafka.connect.connector.Connector
-
config
public org.apache.kafka.common.config.ConfigDef config()- Specified by:
configin classorg.apache.kafka.connect.connector.Connector
-