Configuration
The configuration of the MongoDB sink connector has the following properties.Property
Example
Before using the Mongo sink connector, you need to create a configuration file through one of the following methods.-
JSON
-
YAML
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
The MongoDB sink connector pulls messages from Pulsar topics and persists the messages to collections.
| Name | Type | Required | Sensitive | Default | Description |
|---|---|---|---|---|---|
mongoUri | String | true | true | ” ” (empty string) | The MongoDB URI to which the connector connects. For more information, see connection string URI format. |
database | String | true | false | ” ” (empty string) | The database name to which the collection belongs. |
collection | String | true | false | ” ” (empty string) | The collection name to which the connector writes messages. |
batchSize | int | false | false | 100 | The batch size of writing messages to collections. |
batchTimeMs | long | false | false | 1000 | The batch operation interval in milliseconds. |
{
"mongoUri": "mongodb://localhost:27017",
"database": "pulsar",
"collection": "messages",
"batchSize": "2",
"batchTimeMs": "500"
}
{
mongoUri: "mongodb://localhost:27017"
database: "pulsar"
collection: "messages"
batchSize: 2
batchTimeMs: 500
}
Was this page helpful?