Skip to content

Commit aaba090

Browse files
committed
postgres to mongo incrementing mode
1 parent 604998b commit aaba090

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.adoc

+4-3
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ Teardown:
18971897
scripts/tear-down-smt-aspectj.sh
18981898
----
18991899

1900-
=== Postgres bulk to Mongo
1900+
=== Postgres to Mongo
19011901

19021902
In this example a JDBC source connector will copy rows from a Postgres table to a MongoDB collection. Rows containing a JSON CLOB not properly parsable will be sent to DLQ topic.
19031903

@@ -1929,9 +1929,10 @@ A JDBC source connector will be created with this link:postgres-to-mongo/config/
19291929
"connection.user": "postgres",
19301930
"connection.password": "postgres",
19311931
"table.whitelist": "accounts",
1932-
"mode": "bulk",
1932+
"mode": "incrementing",
1933+
"incrementing.column.name": "seq_id",
19331934
"topic.prefix": "jdbc_",
1934-
"poll.interval.ms": "600000",
1935+
"poll.interval.ms": "5000",
19351936
"numeric.mapping": "best_fit",
19361937
"value.converter": "io.confluent.connect.avro.AvroConverter",
19371938
"key.converter": "org.apache.kafka.connect.json.JsonConverter",

postgres-to-mongo/config/create-tables.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CREATE TABLE accounts (
2-
ID VARCHAR PRIMARY KEY,
2+
SEQ_ID SERIAL PRIMARY KEY
3+
ID VARCHAR,
34
SSN VARCHAR
45
);
56

postgres-to-mongo/config/jdbc_psql_source.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"connection.user": "postgres",
88
"connection.password": "postgres",
99
"table.whitelist": "accounts",
10-
"mode": "bulk",
10+
"mode": "incrementing",
11+
"incrementing.column.name": "seq_id",
1112
"topic.prefix": "jdbc_",
12-
"poll.interval.ms": "600000",
13+
"poll.interval.ms": "5000",
1314
"numeric.mapping": "best_fit",
1415
"value.converter": "io.confluent.connect.avro.AvroConverter",
1516
"key.converter": "org.apache.kafka.connect.json.JsonConverter",

0 commit comments

Comments
 (0)