Hello All,
we have install kafka, kafka connect and mongodb as a docker compose file, it is working on and our kafka message working fine
and using below sink connect json file. for connectiong kafka message to staore in mongodb database
{
“connector.class”: “com.mongodb.kafka.connect.MongoSinkConnector”,
“tasks.max”: “1”,
“topics”: “kafka-topic”,
“connection.uri”: “mongodb://abc:xyz@0.0.0.0:27017”,
“database”: “dev”,
“collection”: “kafka”,
“key.converter”: “org.apache.kafka.connect.storage.StringConverter”,
“value.converter”: “org.apache.kafka.connect.json.JsonConverter”,
“value.converter.schemas.enable”: “true”,
“document.id.strategy”:“com.mongodb.kafka.connect.sink.processor.id.strategy.UuidStrategy”,
"mongodb.authsource": "admin",
"mongodb.username": "root",
"mongodb.password": "example",
“writemodel.strategy”: “com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy”,
“document.id.strategy”: “com.mongodb.kafka.connect.sink.processor.id.strategy.PartialValueStrategy”,
“document.id.strategy.partial.value.projection.type”: “AllowList”,
“document.id.strategy.partial.value.projection.list”: “businessKeyField”,
“mongo.errors.log.enable”: “true”,
“errors.tolerance”: “all”,
“errors.log.enable”: “true”,
“errors.log.include.messages”: “true”
}
it is also working fine but kafka message not store in our mongodb database.
Thanks,
Pankaj D