Class SourceInfo


@NotThreadSafe public final class SourceInfo extends BaseSourceInfo
Information about the source of information, which for normal events contains information about the transaction id and the LSN position in the server WAL.

The source partition information describes the database server for which we're streaming changes. Typically, the server is identified by the host address port number and the name of the database. Here's a JSON-like representation of an example database:

 {
     "server" : "production-server"
 }
 

The source offset information describes a structure containing the position in the server's WAL for any particular event, transaction id and the server timestamp at which the transaction that generated that particular event has been committed. When performing snapshots, it may also contain a snapshot field which indicates that a particular record is created while a snapshot it taking place. Here's a JSON-like representation of an example:

 {
     "ts_usec": 1465937,
     "lsn" : 99490,
     "txId" : 123,
     "snapshot": true
 }
 
The "ts_usec" field contains the microseconds since Unix epoch (since Jan 1, 1970) representing the time at which the transaction that generated the event was committed while the "txId" represents the server's unique transaction identifier. The "lsn" field represent a numerical (long) value corresponding to the server's LSN for that particular event and can be used to uniquely identify an event within the WAL. The source struct appears in each message envelope and contains information about the event. It is a mixture the fields from the partition and offset. Like with the offset, the "snapshot" field only appears for events produced when the connector is in the middle of a snapshot. Here's a JSON-like representation of the source for an event that corresponds to the above partition and offset:
 {
     "name": "production-server",
     "ts_usec": 1465937,
     "lsn" : 99490,
     "txId" : 123,
     "snapshot": true
 }
 
Author:
Horia Chiorean