Skip to main content
The MongoDB Kafka source connector is a Kafka Connect connector that reads data from MongoDB and writes data to Kafka topics.
This connector is available as a built-in connector on StreamNative Cloud.

Prerequisites

  • The connection.uri is in form of mongodb+srv://username:password@cluster0.xxx.mongodb.net
  • Valid credentials with the read role on the database. For more granular access control, you can specify a custom role that allows find, and changeStream actions on the databases or collections.

Quick Start

  1. Setup the kcctl client: doc
  2. Create a MongoDB Cluster, you can create one in k8s cluster with below yaml file:
  3. Initialize the local MongoDB cluster:
  4. Create a JSON file like the following:
  5. 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.