This connector is available as a built-in connector on StreamNative Cloud.
Prerequisites
- The
connection.uriis in form ofmongodb+srv://username:password@cluster0.xxx.mongodb.net - Valid credentials with the
readrole on the database. For more granular access control, you can specify a custom role that allowsfind, andchangeStreamactions on the databases or collections.
Quick Start
- Setup the kcctl client: doc
-
Create a MongoDB Cluster, you can create one in k8s cluster with below yaml file:
-
Initialize the local MongoDB cluster:
-
Create a JSON file like the following:
-
Run the following command to create the connector:
Configuration
The MongoDB Kafka source connector is configured using the following Required properties:
The full properties are also available from the offical MongoDB Kafka Source Connector documentation.