|
| 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 | + |
0 commit comments