@@ -65,7 +65,7 @@ Settings
65
65
66
66
| When set to ``true``, the connector logs both "tolerated" and
67
67
"not tolerated" errors.
68
- | When set to ``false``, the connector logs "not tolertaed " errors.
68
+ | When set to ``false``, the connector logs "not tolerated " errors.
69
69
70
70
.. note::
71
71
@@ -105,8 +105,11 @@ Settings
105
105
| **Description:**
106
106
| Whether the connector should include context headers when it
107
107
writes messages to the dead letter queue.
108
- | For more information about the dead letter queue, see the
108
+ | To learn more about the dead letter queue, see the
109
109
:ref:`Dead Letter Queue Configuration Example <sink-dead-letter-queue-configuration-example>`.
110
+ | To learn about the exceptions the connector defines and
111
+ reports through context headers, see the
112
+ :ref:`<sink-configuration-error-handling-dlq-errors>` section.
110
113
|
111
114
| **Default:** ``false``
112
115
| **Accepted Values**: ``true`` or ``false``
@@ -126,6 +129,114 @@ Settings
126
129
127
130
.. _sink-configuration-error-handling-table-end:
128
131
132
+ .. _sink-configuration-error-handling-dlq-errors:
133
+
134
+ Bulk Write Exceptions
135
+ ---------------------
136
+
137
+ The connector can report the following exceptions to your dead letter queue
138
+ as context headers when performing bulk writes:
139
+
140
+ .. list-table::
141
+ :header-rows: 1
142
+ :widths: 34 66
143
+
144
+ * - Name
145
+ - Description
146
+
147
+ * - | ``WriteException``
148
+ - | **Description:**
149
+ | Contains details of a
150
+ `BulkWriteError <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/bulk/BulkWriteError.html>`__
151
+ your connector encountered.
152
+ |
153
+ | **Message Format:**
154
+
155
+ This class outputs the error in the following format:
156
+
157
+ .. code-block:: none
158
+
159
+ v=%d, code=%d, message=%s, details=%s
160
+
161
+ The fields in the preceding message contain the following information:
162
+
163
+ - ``v``: The version of the ``WriteException`` message format.
164
+ This field helps parse the messages produced by this exception.
165
+ For version {+connector_version+} of the connector, the version of the
166
+ message format is {+write-exception-version+}.
167
+ - ``code``: The code associated with the error. To learn more see the
168
+ `getCode() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/WriteError.html#getCode()>`__
169
+ method documentation.
170
+ - ``message``: The message associated with the error. To learn more, see the
171
+ `getMessage() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/WriteError.html#getMessage()>`__
172
+ method documentation.
173
+ - ``details``: The details associated with the error in JSON format. To
174
+ learn more, see the following method documentation:
175
+
176
+ - `getDetails() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/WriteError.html#getDetails()>`__
177
+ - `toJson() <{+connector_driver_api_doc_url_base+}apidocs/bson/org/bson/BsonDocument.html#toJson()>`__
178
+
179
+ * - | ``WriteConcernException``
180
+ - | **Description:**
181
+ | Contains details of a
182
+ `WriteConcernError <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/bulk/WriteConcernError.html>`__
183
+ your connector encountered.
184
+ |
185
+ | **Message Format:**
186
+
187
+ This class outputs the error in the following format:
188
+
189
+ .. code-block:: none
190
+
191
+ v=%d, code=%d, codeName=%d, message=%s, details=%s
192
+
193
+ The fields in the preceding message contain the following information:
194
+
195
+ - ``v``: The version of the ``WriteConcernException`` message format.
196
+ This field helps parse the messages produced by this exception.
197
+ For version {+connector_version+} of the
198
+ connector, the version of the message format is
199
+ {+write-concern-exception-version+}.
200
+ - ``code``: The code associated with the error. To learn more see the
201
+ `getCode() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/bulk/WriteConcernError.html#getCode()>`__
202
+ method documentation.
203
+ - ``codeName``: The code name associated with the error. To learn more, see the
204
+ `getCodeName() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/bulk/WriteConcernError.html#getCode()>`__
205
+ method documentation.
206
+ - ``message``: The message associated with the error. To learn more, see the
207
+ `getMessage() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/bulk/WriteConcernError.html#getMessage()>`__
208
+ method documentation.
209
+ - ``details``: The details associated with the error in JSON format. To
210
+ learn more, see the following method documentation:
211
+
212
+ - `getDetails() <{+connector_driver_api_doc_url_base+}apidocs/mongodb-driver-core/com/mongodb/bulk/WriteConcernError.html#getDetails()>`__
213
+ - `toJson() <{+connector_driver_api_doc_url_base+}apidocs/bson/org/bson/BsonDocument.html#toJson()>`__
214
+
215
+ * - | ``WriteSkippedException``
216
+ - | **Description:**
217
+ | Informs that MongoDB did not attempt the write of a ``SinkRecord`` as part of
218
+ the following scenario:
219
+
220
+ #. The connector sends an ordered bulk write operation to MongoDB
221
+ #. MongoDB fails to process a write operation in the ordered bulk write
222
+ #. MongoDB does not attempt to perform all subsequent write operations in the ordered bulk write
223
+
224
+ | To learn how to set the connector to perform unordered bulk
225
+ write operations, see the :ref:`<sink-configuration-message-processing>` page.
226
+ | **Message Format:**
227
+
228
+ This exception produces no message.
229
+
230
+ To enable bulk write exception reporting to the dead letter queue, use the
231
+ following connector configuration:
232
+
233
+ .. code-block:: properties
234
+ :emphasize-lines: 3
235
+
236
+ errors.tolerance=all
237
+ errors.deadletterqueue.topic.name=<name of topic to use as dead letter queue>
238
+ errors.deadletterqueue.context.headers.enable=true
239
+
129
240
.. _sink-dead-letter-queue-configuration-example:
130
241
131
242
Dead Letter Queue Configuration Example
0 commit comments