From d40765eb3217dbbc0d2616d9db2465ac9fbe3502 Mon Sep 17 00:00:00 2001 From: dongdongking008 Date: Wed, 25 Aug 2021 20:28:35 +0800 Subject: [PATCH] [postgres] Fix postgres-cdc connector cannot recognize the optional option 'slot.name' --- .../cdc/connectors/postgres/table/PostgreSQLTableFactory.java | 1 + .../connectors/postgres/table/PostgreSQLTableFactoryTest.java | 1 + 2 files changed, 2 insertions(+) diff --git a/flink-connector-postgres-cdc/src/main/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactory.java b/flink-connector-postgres-cdc/src/main/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactory.java index 939887eb4..cc21aa699 100644 --- a/flink-connector-postgres-cdc/src/main/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactory.java +++ b/flink-connector-postgres-cdc/src/main/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactory.java @@ -156,6 +156,7 @@ public class PostgreSQLTableFactory implements DynamicTableSourceFactory { Set> options = new HashSet<>(); options.add(PORT); options.add(DECODING_PLUGIN_NAME); + options.add(SLOT_NAME); return options; } } diff --git a/flink-connector-postgres-cdc/src/test/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactoryTest.java b/flink-connector-postgres-cdc/src/test/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactoryTest.java index 3a1b58d30..df89b1ba7 100644 --- a/flink-connector-postgres-cdc/src/test/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactoryTest.java +++ b/flink-connector-postgres-cdc/src/test/java/com/ververica/cdc/connectors/postgres/table/PostgreSQLTableFactoryTest.java @@ -96,6 +96,7 @@ public class PostgreSQLTableFactoryTest { options.put("port", "5444"); options.put("decoding.plugin.name", "wal2json"); options.put("debezium.snapshot.mode", "never"); + options.put("slot.name", "flink"); DynamicTableSource actualSource = createTableSource(options); Properties dbzProperties = new Properties();