Skip to content

Commit

Permalink
improve tech for debezium-postgresql example (#7499)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: b8d0e0eb5038ff88ed3d2ec3c27555da3103cd2c
  • Loading branch information
zxqfd555-pw authored and Manul from Pathway committed Oct 21, 2024
1 parent 8964da9 commit aa380df
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
42 changes: 25 additions & 17 deletions examples/projects/debezium-postgres-example/debezium/connector.sh
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ services:
postgres:
container_name: db_tuto_postgres
image: debezium/postgres:13
ports:
- 5432:5432
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
Expand All @@ -28,8 +26,6 @@ services:
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_JMX_PORT: 9991
ports:
- 9092:9092
debezium:
container_name: db_tuto_debezium
image: debezium/connect:1.4
Expand All @@ -41,8 +37,6 @@ services:
volumes:
- ./debezium/connector.sh:/kafka/connector.sh
depends_on: [kafka]
ports:
- 8083:8083
pathway:
container_name: db_tuto_pathway
build:
Expand Down
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"]

0 comments on commit aa380df

Please sign in to comment.