Overview
Use the following MongoDB Kafka sink connector configuration settings to override global or default property settings for specific topics.
For a list of sink connector configuration settings organized by category, see the guide on Sink Connector Configuration Properties.
Settings
Name | Description |
|---|---|
topic.override.<topicName>.<propertyName> | Type: string |
Example
You can override the sink connector to sink data from specific topics. The following example configuration shows how you can define configuration settings for a topic named topicA:
topic.override.topicA.collection=collectionA topic.override.topicA.max.batch.size=100 topic.override.topicA.document.id.strategy=com.mongodb.kafka.connect.sink.processor.id.strategy.UuidStrategy topic.override.topicA.post.processor.chain=com.mongodb.kafka.connect.sink.processor.DocumentIdAdder,com.mongodb.kafka.connect.sink.processor.BlockListValueProjector topic.override.topicA.value.projection.type=BlockList topic.override.topicA.value.projection.list=k2,k4
After applying these configuration settings, the sink connector performs the following for data consumed from topicA:
Write documents to the MongoDB collection
collectionAin batches of up to 100.Generate a UUID value for each new document and write it to the
_idfield.Omit fields
k2andk4from the value projection using theBlockListprojection type.
For an example of how to configure the Block List Projector, see the Post Processors guide.