Can I customize Kafka topic from MongoSourceConnector?

I want to send Kafka messages to one topic from several MongoSourceConnectors.
That is, what I want: ( MongoSourceConnector : Kafka topic = N : 1 )

However, I know that Kafka messages from MongoSourceConnector are created automatically like {prefix}.{dbName}.{collectionName} , so it seems to be MongoSourceConnector : Kafka topic = 1 : 1 relation.

Can I customize the topic name from each MongoSourceConnector?

Hi @Hyunsang_h ,

Good question! I’m pleased to let you know that you can configure the topic mapping.

By default the mapping is:


However, you can configure overrides like so:

topic.suffix=""{"db1.coll1": "db1Collection1Topic", "db2": "everythingFromDb2", "*": "everyThingElseTopic"}


I realise that the documentation is lacking all the examples, so I have filed a ticket to get it updated.



Thank you sooooooo much!!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.