Kafka HDFS Connect是否支持通过模式指定订阅主题?
Great question! The short answer is yes—Kafka HDFS Connect absolutely supports subscribing to either a list of specific topics or using a topic pattern match, even if you didn't spot these configs in the HDFS Connector's dedicated documentation.
Here's how it works:
Subscribe to a fixed list of topics
Use thetopicsconfiguration property (a core Kafka Connect setting, not HDFS-specific) to list comma-separated topic names. For example:topics=user_events,order_updates,payment_logsSubscribe using a topic regex pattern
If you want to match dynamically against topics that follow a naming pattern, use thetopic.regexproperty instead. This will capture all existing (and future-created) topics that match the regex. For example, to match all topics starting withkafka_hdfs_:topic.regex=kafka_hdfs_.*Important note: Don't set both
topicsandtopic.regexat the same time—they're mutually exclusive, and the connector will throw an error if you try.
Quick Notes
- These are core Kafka Connect framework configurations, not unique to the HDFS Connector, which is why they don't appear in the HDFS-specific docs.
- When using
topic.regex, the connector will automatically detect new topics that match the pattern while it's running—no need to restart the connector. - Make sure the connector's service account has read access to all topics that match your pattern, otherwise you'll run into authorization errors.
内容的提问来源于stack exchange,提问作者Naveen

