Package org.apache.kafka.connect.tools
Class VerifiableSourceTask
java.lang.Object
org.apache.kafka.connect.source.SourceTask
org.apache.kafka.connect.tools.VerifiableSourceTask
- All Implemented Interfaces:
org.apache.kafka.connect.connector.Task
public class VerifiableSourceTask
extends org.apache.kafka.connect.source.SourceTask
A connector primarily intended for system tests. The connector simply generates as many tasks as requested. The
tasks print metadata in the form of JSON to stdout for each message generated, making externally visible which
messages have been sent. Each message is also assigned a unique, increasing seqno that is passed to Kafka Connect; when
tasks are started on new nodes, this seqno is used to resume where the task previously left off, allowing for
testing of distributed Kafka Connect.
If logging is left enabled, log output on stdout can be easily ignored by checking whether a given line is valid JSON.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.kafka.connect.source.SourceTask
org.apache.kafka.connect.source.SourceTask.TransactionBoundary -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.kafka.connect.source.SourceTask
TRANSACTION_BOUNDARY_CONFIG -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.kafka.connect.source.SourceTask
commit, initialize
-
Field Details
-
NAME_CONFIG
- See Also:
-
ID_CONFIG
- See Also:
-
TOPIC_CONFIG
- See Also:
-
THROUGHPUT_CONFIG
- See Also:
-
COMPLETE_RECORD_DATA_CONFIG
- See Also:
-
-
Constructor Details
-
VerifiableSourceTask
public VerifiableSourceTask()
-
-
Method Details
-
version
-
start
- Specified by:
startin interfaceorg.apache.kafka.connect.connector.Task- Specified by:
startin classorg.apache.kafka.connect.source.SourceTask
-
poll
- Specified by:
pollin classorg.apache.kafka.connect.source.SourceTask
-
commitRecord
public void commitRecord(org.apache.kafka.connect.source.SourceRecord record, org.apache.kafka.clients.producer.RecordMetadata metadata) - Overrides:
commitRecordin classorg.apache.kafka.connect.source.SourceTask
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.kafka.connect.connector.Task- Specified by:
stopin classorg.apache.kafka.connect.source.SourceTask
-