|
| 1 | +=================================== |
| 2 | +Connector Error Handling Properties |
| 3 | +=================================== |
| 4 | + |
| 5 | +.. default-domain:: mongodb |
| 6 | + |
| 7 | +.. contents:: On this page |
| 8 | + :local: |
| 9 | + :backlinks: none |
| 10 | + :depth: 2 |
| 11 | + :class: singlecol |
| 12 | + |
| 13 | +Overview |
| 14 | +-------- |
| 15 | + |
| 16 | +Use the following configuration settings to specify how the sink connector |
| 17 | +handles errors and to configure the dead letter queue. |
| 18 | + |
| 19 | +For a list of categories of sink connector configuration settings, see the |
| 20 | +guide on :doc:`Sink Connector Configuration Properties </sink-connector/configuration-properties>`. |
| 21 | + |
| 22 | +Settings |
| 23 | +-------- |
| 24 | + |
| 25 | +.. list-table:: |
| 26 | + :header-rows: 1 |
| 27 | + :widths: 50 50 |
| 28 | + |
| 29 | + * - Name |
| 30 | + - Description |
| 31 | + |
| 32 | + * - | **mongo.errors.tolerance** |
| 33 | + - | **Type:** string |
| 34 | + | |
| 35 | + | **Description:** |
| 36 | + | Whether to continue processing messages if the connector encounters |
| 37 | + an error. |
| 38 | + | When set to ``none``, the connector reports any error and |
| 39 | + blocks further processing of the rest of the messages. |
| 40 | + | When set to ``all``, the connector ignores any problematic messages. |
| 41 | + |
| 42 | + .. note:: |
| 43 | + |
| 44 | + This property overrides the `errors.tolerance <https://docs.confluent.io/platform/current/installation/configuration/connect/sink-connect-configs.html#sinkconnectorconfigs_errors.tolerance>`__ |
| 45 | + property of the Connect Framework. |
| 46 | + |
| 47 | + | **Default:** ``"none"`` |
| 48 | + | **Accepted Values**: ``"none"`` or ``"all"`` |
| 49 | + |
| 50 | + * - | **mongo.errors.log.enable** |
| 51 | + - | **Type:** boolean |
| 52 | + | |
| 53 | + | **Description:** |
| 54 | + | Whether the connector should write details of errors including |
| 55 | + failed operations to the log file. The connector classifies |
| 56 | + errors as "tolerated" or "not tolerated" using the |
| 57 | + ``errors.tolerance`` or ``mongo.errors.tolerance`` settings. |
| 58 | + |
| 59 | + | When set to ``true``, the connector logs both "tolerated" and |
| 60 | + "not tolerated" errors. |
| 61 | + | When set to ``false``, the connector logs "not tolertaed" errors. |
| 62 | + |
| 63 | + .. note:: |
| 64 | + |
| 65 | + This property overrides the `errors.log.enable <https://docs.confluent.io/platform/current/installation/configuration/connect/sink-connect-configs.html#sinkconnectorconfigs_errors.log.enable>`__ |
| 66 | + property of the Connect Framework. |
| 67 | + |
| 68 | + | **Default:** ``false`` |
| 69 | + | **Accepted Values**: ``true`` or ``false`` |
| 70 | + |
| 71 | + * - | **errors.log.include.messages** |
| 72 | + - | **Type:** boolean |
| 73 | + | |
| 74 | + | **Description:** |
| 75 | + | Whether the connector should include the invalid message when |
| 76 | + logging an error. An invalid message includes data such as record |
| 77 | + keys, values, and headers. |
| 78 | + | |
| 79 | + | **Default:** ``false`` |
| 80 | + | **Accepted Values**: ``true`` or ``false`` |
| 81 | + |
| 82 | + * - | **errors.deadletterqueue.topic.name** |
| 83 | + - | **Type:** string |
| 84 | + | |
| 85 | + | **Description:** |
| 86 | + | Name of topic to use as the dead letter queue. If blank, the |
| 87 | + connector does not send any invalid messages to the dead letter |
| 88 | + queue. |
| 89 | + | For more information about the dead letter queue, see the |
| 90 | + :ref:`Dead Letter Queue Configuration Example <sink-dead-letter-queue-configuration-example>`. |
| 91 | + | |
| 92 | + | **Default:** ``""`` |
| 93 | + | **Accepted Values**: A valid Kafka topic name |
| 94 | + |
| 95 | + * - | **errors.deadletterqueue.context.headers.enable** |
| 96 | + - | **Type:** boolean |
| 97 | + | |
| 98 | + | **Description:** |
| 99 | + | Whether the connector should include context headers when it |
| 100 | + writes messages to the dead letter queue. |
| 101 | + | For more information about the dead letter queue, see the |
| 102 | + :ref:`Dead Letter Queue Configuration Example <sink-dead-letter-queue-configuration-example>`. |
| 103 | + | |
| 104 | + | **Default:** ``false`` |
| 105 | + | **Accepted Values**: ``true`` or ``false`` |
| 106 | + |
| 107 | + * - | **errors.deadletterqueue.topic.replication.factor** |
| 108 | + - | **Type:** integer |
| 109 | + | |
| 110 | + | **Description:** |
| 111 | + | The number of nodes on which to replicate the dead letter queue |
| 112 | + topic. If you are running a single-node Kafka cluster, you must |
| 113 | + set this to ``1``. |
| 114 | + | For more information about the dead letter queue, see the |
| 115 | + :ref:`Dead Letter Queue Configuration Example <sink-dead-letter-queue-configuration-example>`. |
| 116 | + | |
| 117 | + | **Default:** ``3`` |
| 118 | + | **Accepted Values**: A valid number of nodes |
| 119 | + |
| 120 | + |
| 121 | +.. _sink-dead-letter-queue-configuration-example: |
| 122 | + |
| 123 | +Dead Letter Queue Configuration Example |
| 124 | +--------------------------------------- |
| 125 | + |
| 126 | +Apache Kafka version 2.6 added support for handling errant records. The |
| 127 | +Kafka connector automatically sends messages that it cannot process to the |
| 128 | +**dead letter queue**. Once on the dead letter queue, you can inspect the |
| 129 | +errant records, update them, and resubmit them for processing. |
| 130 | + |
| 131 | +The following is an example configuration for enabling the dead letter queue |
| 132 | +topic ``example.deadletterqueue``. This configuration specifies that the |
| 133 | +dead letter queue and log file should record invalid messages, and that |
| 134 | +the dead letter queue messages should include context headers. |
| 135 | + |
| 136 | +.. code-block:: properties |
| 137 | + |
| 138 | + mongo.errors.tolerance=all |
| 139 | + mongo.errors.log.enable=true |
| 140 | + errors.log.include.messages=true |
| 141 | + errors.deadletterqueue.topic.name=example.deadletterqueue |
| 142 | + errors.deadletterqueue.context.headers.enable=true |
| 143 | + |
0 commit comments