offset: 2 position: 813 CreateTime: 1536580522209 isvalid: true keysize: 19 valuesize: 296 magic: 2 compresscodec: NONE producerId: -1 producerEpoch: -1 sequence: -1 isTransactional: false headerKeys: [] key: {"id":"id1 "} payload: {"before":{"id":"id1 ","code":null},"after":null,"source":{"version":"0.8.2","name":"DB_TEST_SERVER","db":"test","ts_usec":1536580521883194000,"txId":934145,"lsn":3322629136,"schema":"public","table":"test_table","snapshot":false,"last_snapshot_record":null},"op":"d","ts_ms":1536580521895}
offset: 3 position: 1198 CreateTime: 1536580522210 isvalid: true keysize: 19 valuesize: -1 magic: 2 compresscodec: NONE producerId: -1 producerEpoch: -1 sequence: -1 isTransactional: false headerKeys: []When a row is deleted, the delete event value listed above still works with log compaction, since Kafka can still remove all earlier messages with that same key. But only if the message value is null will Kafka know that it can remove all messages with that same key. To make this possible, Debezium’s PostgreSQL connector always follows the delete event with a special tombstone event that has the same key but null value.
offset: 4 position: 1197 CreateTime: 1536656016185 isvalid: true keysize: 19 valuesize: 296 magic: 2 compresscodec: NONE producerId: -1 producerEpoch: -1 sequence: -1 isTransactional: false headerKeys: [] key: {"id":"id1 "} payload: {"before":{"id":"id1 ","code":null},"after":null,"source":{"version":"0.8.2","name":"DB_TEST_SERVER","db":"test","ts_usec":1536656015996952000,"txId":934157,"lsn":3322648864,"schema":"public","table":"test_table","snapshot":false,"last_snapshot_record":null},"op":"d","ts_ms":1536656016014}
offset: 5 position: 1197 CreateTime: 1536656016186 isvalid: true keysize: 19 valuesize: -1 magic: 2 compresscodec: NONE producerId: -1 producerEpoch: -1 sequence: -1 isTransactional: false headerKeys: []
{
"change": [
{
"kind": "delete",
"schema": "public",
"table": "test_table",
"oldkeys": {
"keynames": ["id"],
"keytypes": ["character(10)"],
"keyvalues": ["id1 "]
}
}
]
}./bin/kafka-console-consumer --bootstrap-server localhost:9092 --topic DB_TEST_SERVER.public.test_table{"before":null,"after":{"id":"id1 ","code":"code1 "},"source":{"version":"0.8.1.Final","name":"DB_TEST_SERVER","ts_usec":1536660870391831000,"txId":934165,"lsn":3322655293,"snapshot":false,"last_snapshot_record":null},"op":"c","ts_ms":1536660870430}{"before":{"id":"id1 ","code":null},"after":null,"source":{"version":"0.8.1.Final","name":"DB_TEST_SERVER","ts_usec":1536660879723011000,"txId":934166,"lsn":3322656312,"snapshot":false,"last_snapshot_record":null},"op":"d","ts_ms":1536660879738}
null