Class SourceRecord


public class SourceRecordextends ConnectRecord<SourceRecord>

SourceRecords are generated by SourceTasks and passed to Kafka Connect for storage in Kafka. In addition to the standard fields in ConnectRecord which specify where data is stored in Kafka, they also include a sourcePartition and sourceOffset.

The sourcePartition represents a single input sourcePartition that the record came from (e.g. a filename, table name, or topic-partition). The sourceOffset represents a position in that sourcePartition which can be used to resume consumption of data.

These values can have arbitrary structure and should be represented using org.apache.kafka.connect.data objects (or primitive values). For example, a database connector might specify the sourcePartition as a record containing { "db": "database_name", "table": "table_name"} and the sourceOffset as a Long containing the timestamp of the row.