Docs Home → MongoDB Kafka Connector
Kafka Topic Properties
Overview
Use the following configuration settings to specify which Kafka topics the MongoDB Kafka source connector should publish data to.
For a list of source connector configuration settings organized by category, see the guide on Source Connector Configuration Properties.
Settings
Name | Description | ||||
---|---|---|---|---|---|
topic.prefix | Type: string Description: The prefix to prepend to database and collection names to
generate the name of the Kafka topic on which to publish the data. TipSee also:Default: "" Accepted Values: A string composed of ASCII alphanumeric
characters including ".", "-", and "_" | ||||
topic.suffix | Type: string Description: The suffix to append to database and collection names to
generate the name of the Kafka topic on which to publish the data. TipSee also:Default: "" Accepted Values: A string composed of ASCII alphanumeric
characters including ".", "-", and "_" | ||||
topic.namespace.map | Type: string Description: Specifies a JSON mapping between change stream document
namespaces
and topic names. ExampleThe following mapping instructs the connector to perform the following actions:
The following examples show which topic the connector sends different change stream documents to using the preceding mapping:
You can use the "*" wildcard character to match change stream
document namespaces.ExampleThe following mapping instructs the connector to publish all change
stream documents to the
Default: "" Accepted Values: A valid JSON object | ||||
topic.separator | Type: string Description: Specifies the string the connector uses to concatenate the values used
to create the name of your topic. The connector publishes records to a
topic with a name formed by concatenating the values of the following fields
in the following order:
ExampleThe following configuration instructs the connector to publish
change stream documents from the
ImportantTopic Separator and Topic Namespace MapWhen you use the Default: "." Accepted Values: A string | ||||
topic.mapper | Type: string Description: The Java class that defines your custom topic mapping logic. Default: com.mongodb.kafka.connect.source.topic.mapping.DefaultTopicMapper Accepted Values: Valid full class name of an implementation
of the TopicMapper
class. |