source
Kafka Connect MongoDB Source
The official MongoDB Kafka Connect Source connector.

Available on
StreamNative Cloud console

Authored by
MongoDB
Support type
Community
License
Apache License 2.0

The MongoDB Kafka source connector is a Kafka Connect connector that reads data from MongoDB and writes data to Kafka topics.

Prerequisites

  • The connection.uri is in form of mongodb+srv://username:[email protected]
  • 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.

Configuration

The MongoDB Kafka source connector is configured using the following Required properties:

ParameterDescription
connection.uriThe connection URI for the MongoDB server.
databaseThe MongoDb database from which the connector imports data into Redpanda topics. The connector monitors changes in this database. Leave the field empty to watch all databases.
collectionThe collection in the MongoDB database to watch. If not set, then all collections are watched.
topic.prefixThe prefix for the Kafka topics that the connector creates. The connector appends a database name and collection name to this prefix to create the topic name.

The full properties are also available from the offical MongoDB Kafka Source Connector documentation.