A Kafka topic is not created when I use start the Debezium connector for PostgreSQL. Here's what I have in my properties file:
name=testdb
connector.class=io.debezium.connector.postgresql.PostgresConnector
topic.prefix=test
database.hostname=localhost
database.port=5432
database.user=postgres
database.password=root
database.dbname=testdb
database.server.name=testdb
table.include.list=ipaddrs
plugin.name=pgoutput
According to this, the topic should be named testdb.myschema.ipaddrs
(myschema
is the name of my schema). However bin/kafka-topics.sh --list --bootstrap-server 192.168.56.1:9092
returns nothing. A topic is not created if I add a row to table ipaddrs
.
Kakfka connect starts up successfully when I run bin/connect-standalone.sh config/connect-standalone.properties config/postgres.properties
without any exceptions.
I have auto.create.topics.enable = true
. http://localhost:8083/connectors/testdb/status
shows this:
{"name":"testdb","connector":{"state":"RUNNING","worker_id":"10.0.0.48:8083"},"tasks":[{"id":0,"state":"RUNNING","worker_id":"10.0.0.48:8083"}],"type":"source"}
I am not running Zookeeper. I am running Kafka with KRaft.
CodePudding user response:
Assuming the database has the correct configuration to work with the Debezium postgreSQL connector, you can remove "database.dbname" if ipaddrs is table name not repeated in another schema.
CodePudding user response:
table.include.list
was not correct. It has to include the schema. So it should have been myschema.ipaddrs
in my example. In addition, it seems like the documentation is incorrect for the topic name. In my system it is <topic.prefix>.<table name>
. So in my example, it's test.myschema.ipaddrs
.