I am using confluent kafka connect to capture CDC from MS SQL(source) to MongoDB(sink).
This is the source connecetor used for MS SQL debezium-debezium-connector-sqlserver-1.5.0.
PFB source connector config.
With this we are able to consume the data.
However when we try to sink this data to mongoDB collection using 'hpgrahsl-kafka-connect-mongodb-1.4.0' we are able to push the data to MongoDB but in the below format.
Hi,
I am using confluent kafka connect to capture CDC from MS SQL(source) to MongoDB(sink). This is the source connecetor used for MS SQL debezium-debezium-connector-sqlserver-1.5.0. PFB source connector config.
"config":{ "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector", "key.converter":"org.apache.kafka.connect.json.JsonConverter", "value.converter":"org.apache.kafka.connect.json.JsonConverter", "key.converter.schemas.enable":false, "value.converter.schemas.enable":false, "database.server.name": "test", "database.dbname": "testdb", "database.hostname": "", "database.port": "1433", "database.user": "", "database.password": "****", "database.history.kafka.bootstrap.servers": "localhost:9092", "database.history.kafka.topic": "schema_db"}
With this we are able to consume the data. However when we try to sink this data to mongoDB collection using 'hpgrahsl-kafka-connect-mongodb-1.4.0' we are able to push the data to MongoDB but in the below format.
Mongo doc structure as follows:
/**
CDC is not handled and for each change we are getting a new record instead of updating the existing records.
Sink config as follows:
"config": { "connector.class": "at.grahsl.kafka.connect.mongodb.MongoDbSinkConnector", "topics": "test.dbo.Inventory1", "mongodb.connection.uri": "mongodb://localhost:27017/kafkaconnect?w=1&journal=true", "mongodb.collection": "mssql-moh", "mongodb.change.data.capture.handler": "at.grahsl.kafka.connect.mongodb.cdc.debezium.rdbms.RdbmsHandler", "key.converter":"org.apache.kafka.connect.json.JsonConverter", "value.converter":"org.apache.kafka.connect.json.JsonConverter", "key.converter.schemas.enable":false, "value.converter.schemas.enable":false
}
Is there a way to handle this ?