Use Postgres tables as sources and sinks
CREATE TABLE
calls in SQL and must be configured
with format = 'debezium_json'
. Otherwise, the options are the same as for other
Kafka sources.
debezium.public.table_name
which will contain
the changes to the public.table_name
table in Postgres.
To verify that this is working, you can use the kafka-console-consumer
tool in your
Kafka installation to read from the topic:
format
to
debezium_json
and the topic
to the Debezium topic you created above.
debezium_table
that will read from the topic
debezium.public.table_name
and will have the schema id int, name string, age int
.
You can then query this table like any other table in Arroyo:
kafka-topics
tool in your Kafka installation:value.converter
is set to org.apache.kafka.connect.json.JsonConverter
. and value.converter.schemas.enable
is set
to true
.On the Arroyo side, you must set the format
to debezium_json
to indicate that the data is in
this format and set 'json.include_schema' = true
to include the schema in the JSON data.