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
* add support to map multiple topics to collections
-full configuration customization for all relevant properties
-test cases for the most vital parts
-TODO documentation
* add documentation for topic/collection-aware processing needs
this PR closes#52
Copy file name to clipboardExpand all lines: README.md
+98Lines changed: 98 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -570,6 +570,104 @@ At the moment the following settings can be configured by means of the *connecto
570
570
| mongodb.value.projection.type | whether or not and which value projection to use | string | none |[none, blacklist, whitelist]| low |
571
571
| mongodb.writemodel.strategy | how to build the write models for the sink documents | string | at.grahsl.kafka.connect.mongodb.writemodel.strategy.ReplaceOneDefaultStrategy || low |
572
572
573
+
The above listed *connector.properties* are the 'original' (still valid / supported) way to configure the sink connector. The main drawback with it is that only one MongoDB collection could be used so far to sink data from either a single / multiple Kafka topic(s).
574
+
575
+
### Collection-aware Configuration Settings
576
+
577
+
In the past several sink connector instances had to be configured and run separately, one for each topic / collection which needed to have individual processing settings applied. Starting with version 1.2.0 it is possible to **configure multiple Kafka topic <-> MongoDB collection mappings.** This allows for a lot more flexibility and **supports complex data processing needs within one and the same sink connector instance.**
578
+
579
+
Essentially all relevant *connector.properties* can now be defined individually for each topic / collection.
580
+
581
+
##### Topic <-> Collection Mappings
582
+
583
+
The most important change in configuration options is about defining the named-relation between configured Kafka topics and MongoDB collections like so:
584
+
585
+
```properties
586
+
587
+
#Kafka topics to consume from
588
+
topics=foo-t,blah-t
589
+
590
+
#MongoDB collections to write to
591
+
mongodb.collections=foo-c,blah-c
592
+
593
+
#Named topic <-> collection mappings
594
+
mongodb.collection.foo-t=foo-c
595
+
mongodb.collection.blah-t=blah-c
596
+
597
+
```
598
+
599
+
##### Individual Settings for each Collection
600
+
601
+
Configuration properties can then be defined specifically for any of the collections for which there is a named mapping defined. The following configuration fragments show how to apply different settings for *foo-c* and *blah-c* MongoDB sink collections.
602
+
603
+
```properties
604
+
605
+
#specific processing settings for topic 'foo-t' -> collection 'foo-c'
***document identity would fallback to the explicitly given default which is the *FullKeyStrategy*** for all collections other than 'foo-c' for which it uses the specified *UuidStrategy*
669
+
***write model strategy would fallback to the implicitly defined *ReplaceOneDefaultStrategy*** for all collections other than 'blah-c' for which it uses the specified *UpdateOneTimestampsStrategy*
0 commit comments