debezium连接器发件箱转换

hs1ihplo  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(416)

我正在尝试使用一个mysql源连接器和debezium支持的outbox smt,配置如下。我使用的是debezium core和debezium mysql connector(1.1)的最新jar

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost: 8083/connectors/ -d '{
    "name": "debezium-mysql-connector",
    "config": {
        "connector.class": "io.debezium.connector.mysql.MySqlConnector",
        "tasks.max": "1",
        "database.hostname": "MySql",
        "database.port": "3306",
        "database.user": "**",
        "database.password": "**",
        "database.server.id": "1033113244",
        "database.server.name": "anomaly-changelog",
        "database.whitelist": "anomaly",
        "database.history.kafka.bootstrap.servers": "Kafka:9092",
        "database.history.kafka.topic": "anomaly.schema.history",
        "transforms": "outbox,reroute",
        "transforms.reroute.type": "org.apache.kafka.connect.transforms.RegexRouter",
        "transforms.reroute.regex": "(.*)",
        "transforms.reroute.replacement": "$1-SMT",
        "transforms.outbox.type": "io.debezium.transforms.outbox.EventRouter"
    }
}'

但我仍然得到以下错误:

{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s):\nInvalid value io.debezium.transforms.outbox.EventRouter for configuration transforms.outbox.type: Class io.debezium.transforms.outbox.EventRouter could not be found.\nInvalid value null for configuration transforms.outbox.type: Not a Transformation}

我不明白为什么不被认出来。

zbsbpyhn

zbsbpyhn1#

您可以尝试以下方法:

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" demo:8083/connectors/ -d '{ "name": "order-connector", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "mariadb_order", "database.port": "3306", "database.user": "root", "database.password": "***", "database.server.id": "223344", "database.server.name": "orderdbserver","table.whitelist": "orderdb.outbox", "transforms": "outbox", "transforms.outbox.type" :"io.debezium.transforms.outbox.EventRouter", "database.history.kafka.bootstrap.servers": "kafka:9092", "database.history.kafka.topic":"dbhistory.orderdb", "transforms.outbox.table.fields.additional.placement" : "aggregateid:envelope:id"  } }'

相关问题