Skip to content

Commit 588c08b

Browse files
biniona-mongodbschmalliso
authored andcommitted
(DOCSP-20789) Namespace Fix (#235)
1 parent 413af3c commit 588c08b

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

source/source-connector/configuration-properties/kafka-topic.txt

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,50 @@ Settings
7676

7777
.. example::
7878

79-
The following mappings instruct the connector to do the following:
79+
The following mapping instructs the connector to perform the following
80+
actions:
8081

8182
- Publish change stream documents originating from the
82-
``myDb.myColl`` MongoDB collection to the ``topicTwo`` Kafka topic.
83-
- Publish all other change stream documents originating from the
84-
``myDb`` MongoDB database to the ``topicOne`` Kafka topic.
83+
``myDb.myColl`` MongoDB collection to the ``topicOne`` Kafka topic.
84+
- Publish change stream documents originating from the
85+
``myDb`` MongoDB database and a collection other than ``myColl``
86+
to the Kafka topic ``topicTwo.<collectionName>``.
87+
- Publish change stream documents originating from the ``myDb``
88+
MongoDB database that do not bear a collection name to
89+
the ``topicTwo`` Kafka topic.
8590

8691
.. code-block:: properties
8792
:copyable: false
8893

89-
topic.namespace.map={"myDb": "topicOne", "myDb.myColl\": "topicTwo"}
94+
topic.namespace.map={"myDb.myColl": "topicOne", "myDb": "topicTwo"}
95+
96+
The following examples show which topic the connector sends
97+
different change stream documents to using the preceding mapping:
9098

91-
| You can use the "*" wildcard character to match change stream
99+
- A change stream document originating from the ``myDb`` database
100+
and the ``myColl`` collection publishes to the
101+
``topicOne`` topic.
102+
- A change stream document originating from the ``myDb`` database
103+
and the ``newColl`` collection publishes to the
104+
``topicTwo.newColl`` topic.
105+
- A change stream document originating from dropping the
106+
``myDb`` database, which does not bear a collection name,
107+
publishes to the ``topicTwo`` topic.
108+
109+
| You can use the ``"*"`` wildcard character to match change stream
92110
document namespaces.
93111

94112
.. example::
95113

96114
The following mapping instructs the connector to publish all change
97-
stream document namespaces to the ``topicThree`` topic:
115+
stream documents to the ``topicThree`` topic:
98116

99117
.. code-block:: properties
100118
:copyable: false
101119

102120
topic.namespace.map={"*": "topicThree"}
103121

104-
| **Default**: ""
122+
| **Default**: ``""``
105123
| **Accepted Values**: A valid JSON object
106124

107125
* - | **topic.separator**

source/source-connector/usage-examples/topic-naming.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ mapping, the connector performs the following actions:
110110
the connector sets the destination to the ``electricVehicles`` topic.
111111
- If the change event came from the database ``carDb`` and a collection
112112
other than ``ev``, the connector sets the destination to the
113-
``automobiles`` topic.
113+
``automobiles.<collectionName>``
114+
topic.
114115
- If the change document came from any database other than ``carDb``, the
115116
connector sets the destination topic to the default namespace naming
116117
scheme.
@@ -135,4 +136,3 @@ namespaces without mappings.
135136
In the preceding wildcard example, the connector publishes change documents
136137
that originated from all databases other than ``carDb`` to the
137138
``otherVehicles`` topic.
138-

0 commit comments

Comments
 (0)