You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| **Accepted Values**: Valid full class name of an implementation
377
+
of the `TopicMapper <https://github.com/mongodb/mongo-kafka/blob/master/src/main/java/com/mongodb/kafka/connect/source/topic/mapping/TopicMapper.java>`__
378
+
class.
379
+
323
380
* - copy.existing
324
381
- boolean
325
382
- | Copy existing data from source collections and convert them to Change Stream events on their respective topics. Any changes to the data that occur during the copy process are applied once the copy is completed.
@@ -535,19 +592,28 @@ ones in the collection named "customers":
535
592
For more information on how to build regular expressions, see the
536
593
`Java SE documentation on Patterns <https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html>`__.
537
594
538
-
.. _topic-naming-example:
539
595
540
-
Topic Naming Example
541
-
--------------------
542
596
543
-
The MongoDB Kafka Source connector publishes the changed data events to
544
-
a Kafka topic that consists of the database and collection name from which
545
-
the change originated. For example, if an insert was performed on the
597
+
Topic Naming Examples
598
+
---------------------
599
+
600
+
By default, the MongoDB Kafka Source connector publishes the change data
601
+
events to a Kafka topic that consists of the database and collection name --
602
+
also known as a :manual:`namespace </reference/limits/#faq-dev-namespace>` --
603
+
from which the change originated. For example, if an insert was performed on the
546
604
``test`` database and ``data`` collection, the connector will publish the
547
605
data to a topic named ``test.data``.
548
606
549
-
If the ``topic.prefix`` configuration is set to **true**, the Kafka topic
550
-
name will be prepended with the specified value. For example:
607
+
The following examples show how you can configure the topic name for
608
+
change data events.
609
+
610
+
.. _topic-naming-prefix-example:
611
+
612
+
Topic Prefix Example
613
+
~~~~~~~~~~~~~~~~~~~~
614
+
615
+
If you specify a value in the ``topic.prefix`` configuration setting, the
616
+
connector prepends that value to the Kafka topic name. For example:
551
617
552
618
.. code-block:: properties
553
619
@@ -556,6 +622,51 @@ name will be prepended with the specified value. For example:
556
622
Once set, any data changes to the ``data`` collection in the ``test`` database
557
623
are published to a topic named ``mongo.test.data``.
558
624
625
+
.. _topic-naming-suffix-example:
626
+
627
+
Topic Suffix Example
628
+
~~~~~~~~~~~~~~~~~~~~
629
+
630
+
If you specify a value in the ``topic.suffix`` configuration setting, the
631
+
connector appends that value to the Kafka topic name. For example:
632
+
633
+
.. code-block:: properties
634
+
635
+
topic.suffix=mongo
636
+
637
+
Once set, any data changes to the ``data`` collection in the ``test`` database
638
+
are published to a topic named ``test.data.mongo``.
639
+
640
+
.. _topic-naming-namespace-map-example:
641
+
642
+
Topic Namespace Map Example
643
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
644
+
645
+
If you specify mappings in the ``topic.namespace.map`` configuration
646
+
setting, the connector publishes using the default topic naming scheme
647
+
unless otherwise specified by the mapping.
648
+
649
+
Any mapping that includes both database and collection takes precedence
650
+
over mappings that only specify the source database name. The following
651
+
configuration example shows mappings for the ``carDb`` database as well as the
0 commit comments