DBZ-6089 Expose sequence in postgres parser

This commit is contained in:
Yang Wu 2023-02-07 23:16:18 -08:00 committed by Jiri Pechanec
parent 517b43b870
commit d7ab7146f0
2 changed files with 5 additions and 2 deletions

View File

@ -25,6 +25,7 @@ public PostgresCloudEventsMaker(RecordParser parser, SerializerType contentType,
public String ceId() {
return "name:" + recordParser.getMetadata(AbstractSourceInfo.SERVER_NAME_KEY)
+ ";lsn:" + recordParser.getMetadata(PostgresRecordParser.LSN_KEY).toString()
+ ";txId:" + recordParser.getMetadata(PostgresRecordParser.TXID_KEY).toString();
+ ";txId:" + recordParser.getMetadata(PostgresRecordParser.TXID_KEY).toString()
+ ";sequence:" + recordParser.getMetadata(PostgresRecordParser.SEQUENCE_KEY).toString();
}
}

View File

@ -25,11 +25,13 @@ public class PostgresRecordParser extends RecordParser {
static final String TXID_KEY = "txId";
static final String XMIN_KEY = "xmin";
static final String LSN_KEY = "lsn";
static final String SEQUENCE_KEY = "sequence";
static final Set<String> POSTGRES_SOURCE_FIELD = Collect.unmodifiableSet(
TXID_KEY,
XMIN_KEY,
LSN_KEY);
LSN_KEY,
SEQUENCE_KEY);
public PostgresRecordParser(Schema schema, Struct record) {
super(schema, record, Envelope.FieldName.BEFORE, Envelope.FieldName.AFTER);