Skip to content

Commit 44b02a2

Browse files
steverenschmalliso
authored andcommitted
DOCSP-10640: [Kafka] Users can implement their own WriteModelStrategy
1 parent 7e62acf commit 44b02a2

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

source/kafka-sink-postprocessors.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,14 @@ strategies are provided with the connector:
691691
- | Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS`` (modified timestamp) fields into documents that match the filters provided by the ``document.id.strategy`` setting.
692692
| Set the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy``
693693

694-
.. note::
695-
696-
Future versions of the MongoDB Kafka Connector will allow developers to
697-
specify a user-created, custom strategy in the configuration settings.
694+
Create Your Own Custom Write Strategy
695+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
696+
697+
If none of the pre-built write strategy models suits your needs, you can
698+
create your own. A custom write strategy model is a Java class that implements
699+
``WriteModelStrategy``. Specify your Java class in the
700+
``mongodb.writemodel.strategy`` :ref:`configuration setting
701+
<kafka-sink-properties>`.
698702

699703
.. _writemodel-strategy-business-key:
700704

source/kafka-sink-properties.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ data to sink to MongoDB. For an example configuration file, see
219219

220220
* - writemodel.strategy
221221
- string
222-
- | The class that specifies the ``WriteModel`` to use for :manual:`Bulk Writes </core/bulk-write-operations/index.html>`.
222+
- | The class that specifies the ``WriteModel`` to use for :manual:`Bulk
223+
Writes </core/bulk-write-operations/index.html>`. See :ref:`Custom
224+
Write Models <custom-write-models>` for more information.
223225
|
224226
| **Default**: ``com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneDefaultStrategy``
225227
| **Accepted Values**: A fully qualified Java class name of a class that implements ``WriteModelStrategy``

0 commit comments

Comments
 (0)