Show
Create a table:
CREATE TABLE IF NOT EXISTS tasks_gon (task_id INT not null primary key, title VARCHAR(255) NOT NULL );
Configure DBZ connector to listen to that table and start a kafka consumer e.g. console consumer. Insert a row, and then delete it. When deleting it, I get these 2 events:
{"schema":{"type":"struct","fields":[{"type":"struct","fields":[{"type":"int32","optional":false,"field":"task_id"},{"type":"string","optional":false,"field":"title"}],"optional":true,"name":"virtatest.virtatest.tasks_gon.Value","field":"before"},{"type":"struct","fields":[{"type":"int32","optional":false,"field":"task_id"},{"type":"string","optional":false,"field":"title"}],"optional":true,"name":"virtatest.virtatest.tasks_gon.Value","field":"after"},{"type":"struct","fields":[{"type":"string","optional":false,"field":"version"},{"type":"string","optional":false,"field":"connector"},{"type":"string","optional":false,"field":"name"},{"type":"int64","optional":false,"field":"ts_ms"},{"type":"string","optional":true,"name":"io.debezium.data.Enum","version":1,"parameters":{"allowed":"true,last,false"},"default":"false","field":"snapshot"},{"type":"string","optional":false,"field":"db"},{"type":"string","optional":true,"field":"table"},{"type":"int64","optional":false,"field":"server_id"},{"type":"string","optional":true,"field":"gtid"},{"type":"string","optional":false,"field":"file"},{"type":"int64","optional":false,"field":"pos"},{"type":"int32","optional":false,"field":"row"},{"type":"int64","optional":true,"field":"thread"},{"type":"string","optional":true,"field":"query"}],"optional":false,"name":"io.debezium.connector.mysql.Source","field":"source"},{"type":"string","optional":false,"field":"op"},{"type":"int64","optional":true,"field":"ts_ms"},{"type":"struct","fields":[{"type":"string","optional":false,"field":"id"},{"type":"int64","optional":false,"field":"total_order"},{"type":"int64","optional":false,"field":"data_collection_order"}],"optional":true,"field":"transaction"}],"optional":false,"name":"virtatest.virtatest.tasks_gon.Envelope"},"payload":{"before":{"task_id":1,"title":"gon"},"after":null,"source":{"version":"1.1.2.Final","connector":"mysql","name":"virtatest","ts_ms":1600755706000,"snapshot":"false","db":"virtatest","table":"tasks_gon","server_id":1,"gtid":"afeb5259-f74d-11ea-a7df-0242ac170006:3398","file":"mysql-bin.000009","pos":18282,"row":0,"thread":7,"query":null},"op":"d","ts_ms":1600755706840,"transaction":null}}
null
The second event is null.
Here is some of the connector config ( I have skipped the database part):
"include.schema.changes": "false",
"database.history.skip.unparseable.ddl": "true",
"inconsistent.schema.handling.mode": "warn",
"event.processing.failure.handling.mode": "warn"
Thank you!