hpgrahsl / kafka-connect-mongodb

**Unofficial / Community** Kafka Connect MongoDB Sink Connector -> integrated 2019 into the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector
Apache License 2.0
153 stars 60 forks source link

Error: `operationType` field is doc is missing #132

Closed hunghoang-ct closed 2 years ago

hunghoang-ct commented 2 years ago

Source connector configuration

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d ' { "name": "announcer-connector",
    "config": { "connector.class": "io.debezium.connector.mongodb.MongoDbConnector",
    "mongodb.members.auto.discover": "true",
    "mongodb.hosts": "10.60.11.66:27017",
    "mongodb.name": "announcer",
    "mongodb.user": "***",
    "mongodb.password": "***",
    "mongodb.ssl.enabled": "false",
    "database.include.list": "announcer",
    "snapshot.mode": "initial"}
          }'

Sink connector configuration

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" \
localhost:8083/connectors/ -d '{"name":"logs-sink-connector","config":{"connector.class":"com.mongodb.kafka.connect.MongoSinkConnector","tasks.max":"1","topics":"announcer.announcer.logs","change.data.capture.handler":"com.mongodb.kafka.connect.sink.cdc.mongodb.ChangeStreamHandler","connection.uri":"mongodb://10.60.11.70:27017","database":"announcer","collection":"logs","transforms":"unwrap","transforms.unwrap.type":"io.debezium.connector.mongodb.transforms.ExtractNewDocumentState","transforms.unwrap.drop.tombstones":false,"transforms.unwrap.delete.handling.mode":"drop","transforms.unwrap.operation.header":true}}'

Caused by: org.apache.kafka.connect.errors.DataException: Error:operationTypefield is doc is missing.