I can't make it work.
Here my json configuration:
{
"name": "lastlook-mongodb-source-connector",
"config": {
"connector.class": "com.mongodb.kafka.connect.MongoSourceConnector",
"tasks.max": "4",
"connection.uri": "mongodb://user:pass@machine1:27017,machine2:27017/?authSource=admin",
"database": "DB",
"collection": "Collection",
"topic": "Topic",
"startup_mode": "copy_existing",
"pipeline":"[]",
"change.stream.full.document":"updateLookup",
"producer.override.sasl.mechanism": "SCRAM-SHA-256",
"producer.override.security.protocol": "SASL_PLAINTEXT",
"producer.override.sasl.jaas.config": "org.apache.kafka.common.security.scram.ScramLoginModule required username=\"user\" password=\"pass\";"
}
}
But for some reason I have the error:
{"error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nInvalid user permissions. Missing the following action permissions: changeStream\nYou can also find the above list of errors at the endpoint
/connector-plugins/{connectorType}/config/validate
"}
Which is not clear at all.
Any info on this ?
EDIT:
As @Sara M. mentioned it was due to a lack of privilege on the mongodb "user" I used to connect to the database.
You need to add the changeStream privilege to that user.
Check first if the user you are using in "connection.uri" has the necessary permissions to perform the changeStream action in MongoDB.
The changeStream action is required for the action that you are trying to do ( "change.stream.full.document":"updateLookup").
Try to add the permission to the user or use an other user with the necessary permissions like root.