-
Notifications
You must be signed in to change notification settings - Fork 45
/
debez-sample-conn.api
38 lines (36 loc) · 1.33 KB
/
debez-sample-conn.api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# these following will be taken from env
# If planning on running this manually (or with run_connect_api.sh) .. set the following vars also
#DB_USER=
#DB_PORT=
#DB_HOSTNAME=
#DB_PASS=
#DB_NAME=
#DB_TABLES=
#DB_PREFIX_INDEX=
DEBEZ_CONN_URL='debezium-service:8083'; # needn't change .. this is the debezium-connector service name
CONNECTOR_HEARTBEAT_MS='5000'; #This is in milliseconds, acts as a status check with Kafka topic.
curl \
-X POST \
http://$DEBEZ_CONN_URL/connectors \
-H 'Content-Type: application/json' \
-d \
'{
"name": '\"$DB_NAME\"',
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"plugin.name": "pgoutput",
"publication.autocreate.mode": "filtered",
"slot.name": '\"debezium_"$DB_NAME"_"$DB_PREFIX_INDEX"\"',
"slot.drop.on.stop": "false",
"publication.name": '\"dbz_pub_"$DB_NAME"_"$DB_PREFIX_INDEX"\"',
"database.hostname": '\"$DB_HOSTNAME\"',
"database.port": '\"$DB_PORT\"',
"database.user": '\"$DB_USER\"',
"database.password": '\"$DB_PASS\"',
"database.dbname": '\"$DB_NAME\"',
"database.server.name": '\"$DB_PREFIX_INDEX\"',
"table.include.list": '\"$DB_TABLES\"',
"heartbeat.interval.ms": '\"$CONNECTOR_HEARTBEAT_MS\"'
}
}';
echo ;