〇、相关地址
一、Confluent
1.1 source
1、实战
{
"name": "confluent-jdbc-pg-source-24033002",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"tasks.max": "1",
"connection.url": "jdbc:postgresql://ip:5432/db",
"connection.user": "postgres",
"connection.password": "passwd",
"table.whitelist": "public.table",
"mode": "bulk",
"topic.prefix": "confluent-pg-24043002",
"poll.interval.ms": "1000",
"topic.creation.default.replication.factor": 1,
"topic.creation.default.partitions": 1,
"confluent.topic.replication.factor": 1
}
}
2、配置说明
1.2 sink
1、实战
(1)全量写入
{
"name": "confluent-jdbc-pg-sink-24043022",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"topics": "rabbitmq-test-24043021",
"connection.url": "jdbc:postgresql://ip:5432/aim",
"connection.user": "postgres",
"connection.password": "Zzh!@7465671",
"auto.create": "true",
"batch.size": 5
}
}
1.3 消息格式
二、Debezium
2.1 source
1、实战
(1)PG cdc
{
"name": "debezium-postgres-source-connector-24043006-dpr",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"tasks.max": "1",
"database.hostname": "ip",
"database.port": "5432",
"database.user": "postgres",
"database.password": "passwd",
"database.dbname": "data_profiling_repo",
"schema.include.list": "public",
"schemas.enable": "true",
"database.history.kafka.bootstrap.servers": "kafka:9092",
"schema.history.internal.kafka.bootstrap.servers": "kafka:9092",
"topic.prefix": "dpr24043001",
"slot.name": "dpr24043002",
"publication.autocreate.mode":"filtered",
"table.include.list":"public.testyu_test_table_bf1",
"publication.name":"dpr_publication_24043004",
"plugin.name": "pgoutput",
"slot.drop.on.stop": "false",
"snapshot.mode": "initial",
"slot.max.retries": "5",
"producer.max.request.size": "9999999",
"producer.override.max.request.size": "999999999",
"connector.client.config.override.policy": "ALL",
"tombstones.on.delete":"false"
}
}
2.2 sink
1、实战
{
"name": "debezium-jdbc-pg-sink-connector-24043001",
"config": {
"connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"connection.url": "jdbc:postgresql://ip:5432/aim",
"connection.username": "postgres",
"connection.password": "passwd",
"insert.mode": "upsert",
"topics": "dpr24043001.public.testyu_test_table_bf1",
"delete.enabled": "true",
"primary.key.mode": "record_key",
"schema.evolution": "basic",
"database.time_zone": "UTC"
}
}
2.3 消息格式