Skip to content

Commit a9fef99

Browse files
Chris Choschmalliso
authored andcommitted
DOCSP-10976 partial id strategy (#51)
* DOCSP-10976: Update PartialKey id strategies
1 parent 3537774 commit a9fef99

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

source/kafka-sink-postprocessors.txt

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ using data contained within multiple fields in the record as well as
707707
instructs the post processor to generate *BSON ObjectIds* for inserts,
708708
but not for updates.
709709

710-
The following steps are required to configure this strategy:
710+
Follow the steps below to configure this strategy:
711711

712712
#. Create a :manual:`unique index </core/index-unique>` that corresponds to
713713
your business key in your target MongoDB collection.
@@ -718,8 +718,8 @@ The following steps are required to configure this strategy:
718718
``ReplaceOneBusinessKeyStrategy`` writemodel strategy.
719719

720720
For this example, we track airplane capacity by the flight number and
721-
airport it is currently located represented by ``flight_no`` and
722-
``airport_code``, respectively. An example message contains the following:
721+
airport location represented by ``flight_no`` and ``airport_code``,
722+
respectively. An example message contains the following:
723723

724724
.. code-block:: json
725725

@@ -732,7 +732,7 @@ airport it is currently located represented by ``flight_no`` and
732732
}
733733
}
734734

735-
In order to implement the strategy, we first create a unique index on the
735+
To implement the strategy, we first create a unique index on the
736736
``flight_no`` and ``airport_code`` fields in the MongoDB shell:
737737

738738
.. code-block:: none
@@ -747,8 +747,8 @@ file:
747747
.. code-block:: properties
748748

749749
document.id.strategy=com.mongodb.kafka.connect.sink.processor.id.strategy.PartialValueStrategy
750-
value.projection.list=flight_no,airport_code
751-
value.projection.type=AllowList
750+
document.id.strategy.partial.value.projection.list=flight_no,airport_code
751+
document.id.strategy.partial.value.projection.type=AllowList
752752
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy"
753753

754754
The sample data inserted into the collection contains the following:
@@ -783,18 +783,6 @@ values without changing the ``_id`` field.
783783
}
784784
}
785785

786-
.. admonition:: Projection post processors are not compatible with PartialValueStrategy
787-
:class: warning
788-
789-
The ``PartialValueStrategy`` id strategy uses the
790-
``[key|value].projection.type`` and ``[key|value].projection.list``
791-
settings to define which fields are used to form the ``_id`` field.
792-
Since the Block List and Allow List post processors use the same
793-
projection settings, they cannot be specified separately. Use a `Single
794-
Message Transform (SMT)
795-
<https://docs.confluent.io/current/connect/transforms/index.html>`_
796-
outside the connector to format your source data as necessary.
797-
798786
.. _writemodel-strategy-timestamps:
799787

800788
WriteModel Strategy: Inserted and Modified Timestamps

0 commit comments

Comments
 (0)