Skip to content

Commit cbac631

Browse files
Chris Choschmalliso
authored andcommitted
DOCSP-19335: migration guide for community driver users (#210)
* DOCSP-19335: migration guide for community driver users
1 parent a9b586c commit cbac631

File tree

4 files changed

+85
-1
lines changed

4 files changed

+85
-1
lines changed

config/redirects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ raw: kafka-connector/ -> ${base}/current/
1818
[*-master]: kafka-connector/${version}/kafka-sink-postprocessors/ -> ${base}/${version}/sink-connector/fundamentals/post-processors/
1919
[*-master]: kafka-connector/${version}/fundamentals/post-processors/ -> ${base}/${version}/sink-connector/fundamentals/post-processors/
2020
[*-master]: kafka-connector/${version}/kafka-sink-time-series-example/ -> ${base}/${version}/tutorials/migrate-time-series/
21-
[*-master]: kafka-connector/${version}/kafka-connect-migration/ -> ${base}/${version}/
21+
[*-master]: kafka-connector/${version}/kafka-connect-migration/ -> ${base}/${version}/migrate-from-kafka-connect-mongodb/
2222

2323
[*-v1.5]: kafka-connector/${version}/tutorials/migrate-time-series/ -> ${base}/${version}/
2424
[*-v1.5]: kafka-connector/${version}/sink-connector/configuration-properties/time-series/ -> ${base}/${version}/

source/index.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ MongoDB Kafka Connector
1919
Sink Connector </sink-connector>
2020
Source Connector </source-connector>
2121
Security and Authentication </security-and-authentication>
22+
Migrate from the Community Connector <migrate-from-kafka-connect-mongodb>
2223
Troubleshooting </troubleshooting>
2324
How to Contribute </contribute>
2425
Issues & Help </issues-and-help>
@@ -43,6 +44,7 @@ sections:
4344
- :doc:`Sink Connector </sink-connector>`
4445
- :doc:`Source Connector </source-connector>`
4546
- :doc:`Security and Authentication </security-and-authentication>`
47+
:doc:`Migrate from the Community Connector </migrate-from-kafka-connect-mongodb>`
4648
- :doc:`Troubleshooting </troubleshooting>`
4749
- :doc:`How to Contribute </contribute>`
4850
- :doc:`Issues & Help </issues-and-help>`
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
.. _migrate-from-kafka-connect-mongodb:
2+
3+
==================================
4+
Migrate from Kafka Connect MongoDB
5+
==================================
6+
7+
.. default-domain:: mongodb
8+
9+
Use this guide to migrate your Kafka deployments from the community-created
10+
:github:`Kafka Connect MongoDB <hpgrahsl/kafka-connect-mongodb>` sink connector
11+
to the :github:`official MongoDB Kafka connector <mongodb/mongo-kafka>`.
12+
13+
The following sections list the changes you must make to your Kafka
14+
Connect sink connector configuration settings and custom classes to transition
15+
to the MongoDB Kafka connector.
16+
17+
Update Configuration Settings
18+
-----------------------------
19+
20+
Make the following changes to the configuration settings of your Kafka Connect
21+
deployment before using them with your MongoDB Kafka connector deployment:
22+
23+
- Replace values that include the package ``at.grahsl.kafka.connect.mongodb``
24+
with the package ``com.mongodb.kafka.connect``.
25+
26+
- Replace your ``connector.class`` setting with the MongoDB Kafka sink
27+
connector class.
28+
29+
.. code-block:: properties
30+
31+
connector.class=com.mongodb.kafka.connect.MongoSinkConnector
32+
33+
- Remove the ``mongodb.`` prefix from your Kafka Connect property names.
34+
For example, change ``mongodb.connection.uri`` to ``connection.uri``.
35+
36+
- Remove the ``document.id.strategies`` setting if it exists. If the value of
37+
this setting reference custom strategies, move them to the
38+
``document.id.strategy`` setting. Read the :ref:`<custom-class-changes>`
39+
section to discover what changes you must make to your custom classes.
40+
41+
- Replace any property names you use to specify per-topic or collection
42+
overrides that contain the ``mongodb.collection`` prefix with the equivalent
43+
key in
44+
:ref:`sink connector Kafka topic configuration topic properties <sink-configuration-topic-properties>`.
45+
46+
.. _custom-class-changes:
47+
48+
Update Custom Classes
49+
---------------------
50+
51+
If you use any custom classes in your Kafka Connect sink connector deployment,
52+
make the following changes to them before adding them to your MongoDB Kafka
53+
connector deployment:
54+
55+
- Replace imports that include ``at.grahsl.kafka.connect.mongodb`` with
56+
``com.mongodb.kafka.connect``.
57+
58+
- Replace references to the ``MongoDbSinkConnector`` class with the
59+
``MongoSinkConnector`` class.
60+
61+
- Update custom sink connector strategy classes to implement the
62+
``com.mongodb.kafka.connect.sink.processor.id.strategy.IdStrategy``
63+
interface.
64+
65+
- Update references to the ``MongoDbSinkConnectorConfig`` class. In the
66+
MongoDB Kafka connector, the logic from that class is split into the
67+
following classes:
68+
69+
- :github:`MongoSinkConfig <mongodb/mongo-kafka/blob/master/src/main/java/com/mongodb/kafka/connect/sink/MongoSinkConfig.java>`
70+
- :github:`MongoSinkTopicConfig <mongodb/mongo-kafka/blob/master/src/main/java/com/mongodb/kafka/connect/sink/MongoSinkTopicConfig.java>`
71+
72+
73+
Update Post Processor Subclasses
74+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+
If you have classes that subclass a post processor in your Kafka Connect
77+
connector deployment, update methods that override ones in the Kafka Connect
78+
``PostProcessor`` class to match the method signatures of the MongoDB Kafka
79+
connector :github:`PostProcessor class <mongodb/mongo-kafka/blob/master/src/main/java/com/mongodb/kafka/connect/sink/processor/PostProcessor.java>`.
80+

source/sink-connector/configuration-properties/kafka-topic.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _sink-configuration-topic-properties:
2+
13
======================
24
Kafka Topic Properties
35
======================

0 commit comments

Comments
 (0)