forked from pathwaycom/pathway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve tech for debezium-postgresql example (#7499)
GitOrigin-RevId: b8d0e0eb5038ff88ed3d2ec3c27555da3103cd2c
- Loading branch information
1 parent
8964da9
commit aa380df
Showing
3 changed files
with
26 additions
and
25 deletions.
There are no files selected for viewing
42 changes: 25 additions & 17 deletions
42
examples/projects/debezium-postgres-example/debezium/connector.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
#!/bin/bash | ||
|
||
curl -H 'Content-Type: application/json' debezium:8083/connectors --data ' | ||
{ | ||
"name": "values-connector", | ||
"config": { | ||
"connector.class": "io.debezium.connector.postgresql.PostgresConnector", | ||
"plugin.name": "pgoutput", | ||
"database.hostname": "postgres", | ||
"database.port": "5432", | ||
"database.user": "user", | ||
"database.password": "password", | ||
"database.dbname" : "values_db", | ||
"database.server.name": "postgres", | ||
"table.include.list": "public.values", | ||
"database.history.kafka.bootstrap.servers": "kafka:9092", | ||
"database.history.kafka.topic": "schema-changes.inventory" | ||
} | ||
}' | ||
while true; do | ||
http_code=$(curl -o /dev/null -w "%{http_code}" -H 'Content-Type: application/json' debezium:8083/connectors --data '{ | ||
"name": "values-connector", | ||
"config": { | ||
"connector.class": "io.debezium.connector.postgresql.PostgresConnector", | ||
"plugin.name": "pgoutput", | ||
"database.hostname": "postgres", | ||
"database.port": "5432", | ||
"database.user": "user", | ||
"database.password": "password", | ||
"database.dbname" : "values_db", | ||
"database.server.name": "postgres", | ||
"table.include.list": "public.values", | ||
"database.history.kafka.bootstrap.servers": "kafka:9092", | ||
"database.history.kafka.topic": "schema-changes.inventory" | ||
} | ||
}') | ||
if [ "$http_code" -eq 201 ]; then | ||
echo "Debezium connector has been created successfully" | ||
break | ||
else | ||
echo "Retrying Debezium connection creation in 1 second..." | ||
sleep 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
examples/projects/debezium-postgres-example/pathway-src/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
FROM --platform=linux/x86_64 python:3.10 | ||
|
||
RUN pip install -U pathway | ||
RUN pip install kafka-python | ||
COPY ./pathway-src/sum.py sum.py | ||
|
||
CMD ["python", "-u", "sum.py"] | ||
CMD ["python", "-u", "sum.py"] |