Debezium’s PostgreSQL Connector can monitor and record the row-level changes in the schemas of a PostgreSQL database. The first time it connects to a PostgreSQL server/cluster, it reads a consistent snapshot of all of the schemas.
When that snapshot is complete, the connector continuously streams the changes that were committed to PostgreSQL 9.6 or later and generates corresponding insert, update and delete events. All of the events for each table are recorded in a separate Kafka topic, where they can be easily consumed by applications and services.
This connector requires the PostgreSQL server have a logical decoding plugin installed and configured. See the documentation for details.
Use the Confluent Hub client to install this connector with:
confluent-hub install debezium/debezium-connector-postgresql:0.8.1
Or download the ZIP file and extract it into one of the directories that is listed on the Connect worker's plugin.path configuration properties. This must be done on each of the installations where Connect will be run. See here for more detailed instructions.
Once installed, you can then create a connector configuration file with the connector's settings, and deploy that to a Connect worker. See here for more detailed instructions.
The source code is located in this repository.
For more information, see the documentation.