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
Copy file name to clipboardExpand all lines: source/kafka-sink-postprocessors.txt
+26-15Lines changed: 26 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -650,9 +650,10 @@ The post processor applied the following changes:
650
650
renaming step if the replacement key already exists at the current level.
651
651
652
652
.. _custom-write-models:
653
+
.. _custom-write-model-strategy:
653
654
654
-
Custom Write Models
655
-
-------------------
655
+
Custom Write Model Strategy
656
+
---------------------------
656
657
657
658
A **write model** defines the behavior of bulk write operations made on a
658
659
MongoDB collection. The default write model for the connector is
@@ -662,8 +663,8 @@ MongoDB collection. The default write model for the connector is
662
663
set to upsert mode.
663
664
664
665
You can override the default write model by specifying a custom one in the
665
-
``mongodb.writemodel.strategy`` configuration setting. The following
666
-
strategies are provided with the connector:
666
+
``writemodel.strategy`` configuration setting. The following strategies are
667
+
provided with the connector:
667
668
668
669
.. list-table::
669
670
:header-rows: 1
@@ -699,26 +700,36 @@ strategies are provided with the connector:
699
700
- | Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS`` (modified timestamp) fields into documents that match the filters provided by the ``document.id.strategy`` setting.
700
701
| Set the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy``
701
702
702
-
Create Your Own Custom Write Strategy
703
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703
+
Create Your Own Custom Write Model Strategy
704
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
704
705
705
-
If none of the pre-built write strategy models suits your needs, you can
706
-
create your own. A custom write strategy model is a Java class that implements
707
-
``WriteModelStrategy``.
706
+
If none of the pre-built write strategies suits your needs, you can
707
+
create your own. A custom write model strategy is a Java class that
708
+
implements ``WriteModelStrategy``.
708
709
709
710
To configure your Sink Connector to use the custom ``WriteModelStrategy``,
710
711
follow the steps below:
711
712
712
713
1. Create a class that implements the ``WriteModelStrategy`` interface
713
714
and overrides the ``createWriteModel(SinkDocument)`` method.
714
715
715
-
#. Compile the class to a ``.class`` file or JAR.
716
+
#. Compile the class to a JAR file.
716
717
717
-
#. Add the class to the Class Path / Plugin Path for Kafka workers.
718
+
#. Add the compiled JAR to the Class Path / Plugin Path for Kafka workers.
718
719
For more information about plugin paths, see the `Confluent documentation
0 commit comments