Debezium Format
Last updated
Last updated
Changelog-Data-Capture Format: Serialization Schema Format: Deserialization Schema
Debezium is a set of distributed services to capture changes in your databases so that your applications can see those changes and respond to them. Debezium records all row-level changes within each database table in a change event stream, and applications simply read these streams to see the change events in the same order in which they occurred.
Nexus supports to interpret Debezium JSON messages as INSERT/UPDATE/DELETE messages into Nexus system. This is useful in many cases to leverage this feature, such as
Nexus also supports to encode the INSERT/UPDATE/DELETE messages in Nexus as Debezium JSON messages, and emit to storage like Kafka.
format
(none)
yes
Specify what format to use, here should be 'debezium_json'.
debezium-json.ignore-parse-errors
false
no
Skip fields and rows with parse errors instead of failing. Fields are set to null in case of errors.
Debezium provides a unified format for changelog, here is a simple example for an update operation captured from a MySQL products table:
The MySQL products table has 4 columns (id, name, description and weight). The above JSON message is an update change event on the products table where the weight value of the row with id = 111 is changed from 5.18 to 5.17. Assuming the messages have been synchronized to Kafka topic products_binlog, then we can use the following Nexus conf to consume this topic and interpret the change events by Debezium format.
In this config, you must specify the schema
and debezium_record_include_schema
options
schema
should same with your table format
if your json data contains schema
field, debezium_record_include_schema
should be true, and if your json data doesn't contains schema
field, debezium_record_include_schema
should be false
{"schema" : {}, "payload": { "before" : {}, "after": {} ... } }
--> true
{"before" : {}, "after": {} ... }
--> false
Note: please refer to about the meaning of each fields.