For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs Menu

Kafka Topic Properties for the Sink Connector

Use the following configuration settings to specify which Kafka topics the MongoDB Kafka sink connector should watch for data.

For a list of sink connector configuration settings organized by category, see the guide on Sink Connector Configuration Properties.

Name
Description

topics

Required

Type: list

Description:
A list of Kafka topics that the sink connector watches.

You can define either the topics or the topics.regex setting, but not both.

Accepted Values: A comma-separated list of valid Kafka topics

topics.regex

Required

Type: string

Description:
A regular expression that matches the Kafka topics that the sink connector watches.

For example, the following regex matches topic names such as "activity.landing.clicks" and "activity.support.clicks". It does not match the topic names "activity.landing.views" and "activity.clicks".

topics.regex=activity\\.\\w+\\.clicks$

You can define either the topics or the topics.regex setting, but not both.

Accepted Values: A valid regular expression pattern using java.util.regex.Pattern.

On this page