Skip to content

Commit 88b7f54

Browse files
steverenschmalliso
authored andcommitted
[Kafka] DOCSP-10640: [Kafka] Users can implement their own WriteModelStrategy
1 parent 0899d2b commit 88b7f54

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/kafka-sink-postprocessors.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,10 @@ Create Your Own Custom Write Strategy
696696

697697
If none of the pre-built write strategy models suits your needs, you can
698698
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>`.
699+
``WriteModelStrategy``.
702700

703-
To create a custom ``WriteModelStrategy``:
701+
To configure your Sink Connector to use the custom ``WriteModelStrategy``,
702+
follow the steps below:
704703

705704
1. Create a class that implements the ``WriteModelStrategy`` interface
706705
and overrides the ``createWriteModel(SinkDocument)`` method.
@@ -711,9 +710,13 @@ To create a custom ``WriteModelStrategy``:
711710
For more information about plugin paths, see the `Confluent documentation
712711
<https://docs.confluent.io/current/connect/managing/community.html>`__.
713712

713+
#. Specify your Java class in the ``mongodb.writemodel.strategy``
714+
:ref:`configuration setting <kafka-sink-properties>`.
715+
714716
The following is an example of a custom write strategy. It extracts the
715717
value of ``fullDocument`` from the value document and returns a
716-
``ReplaceOne`` operation.
718+
``ReplaceOne`` operation. The ``ReplaceOne`` operation replaces a document
719+
in the MongoDB collection that matches the ID from the value document.
717720

718721
.. code-block:: java
719722

0 commit comments

Comments
 (0)