Docs 菜单
Docs 主页
/
MongoDB Kafka Connector
/ /

Kafka 主题属性

在此页面上

  • Overview
  • 设置

使用以下配置设置指定 MongoDB Kafka 源连接器应将数据发布到哪些 Kafka 主题。

有关按类别整理的源Connector配置设置列表,请参阅有关源连接器配置属性的指南。

名称
说明
topic.prefix
Type: string

Description:
Specifies the first part of the destination Kafka topic name to which the connector publishes change stream events. The destination topic name is composed of the topic.prefix value followed by the database and collection names, separated by the value specified in the topic.separator property.

To learn more, see the example in Topic Naming Prefix.

Default: ""
Accepted Values: A string composed of ASCII alphanumeric characters including ".", "-", and "_"
topic.suffix
Type: string

Description:
Specifies the last part of the destination Kafka topic name to which the connector publishes change stream events. The destination topic name is composed of the database and collection names followed by the topic.suffix value, separated by the value specified in the topic.separator property.

To learn more, see the example in Topic Naming Suffix.

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.

You can use to topic.namespace.map property to specify complex mappings. This property supports regex and wildcard matching.

To learn more about these behaviors and view examples, see Topic Namespace Map.

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:
  1. topic.prefix

  2. database

  3. collection

  4. topic.suffix

For example, the following configuration instructs the connector to publish change stream documents from the coll collection of the db database to the prefix-db-coll topic:
topic.prefix=prefix
database=db
collection=coll
topic.separator=-
IMPORTANT: When you use the topic.separator property, note that it doesn't affect how you define the topic.namespace.map property. The topic.namespace.map property uses MongoDB namespaces which you must always specify with a . character to separate the database and collection name.

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

后退

MongoDB 连接

在此页面上