Update debezium-component.adoc to fix some typos and enhance some information about the message body
components/camel-debezium/src/main/docs/debezium-component.adoc | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
*Note on handling failures:* Per https://debezium.io/documentation/reference/0.9/operations/embedded.html#_handling_failures[Debezium Embedded Engine] documentation, the engines is actively recording source offsets and periodically flushes these offsets to a persistent storage, so when the application is restarted or crashed, the engine will resume from the last recorded offset.
Thus, at normal operation, your downstream routes will receive each event exactly once, however in case of an application crash (not having a graceful shutdown), the application will resume from the last recorded offset,
@@ -31,7 +31,7 @@ debezium:connector-type[?options]
*Note:* Other Debezium connectors are _not_ supported at the moment.
@@ -176,6 +176,9 @@ The following headers are available when consuming change events from Debezium.
| DebeziumConstants.HEADER_BEFORE | "CamelDebeziumBefore" | Map/Struct | If presents, contains the state of the row before the event occurred.
+== Message body
+The message body if is not `null` (in case of tombstones), it contains the state of the row after the event occurred as `Struct` format or `Map` format if you use the included Type Converter from `Struct` to `Map` (please look below for more explanation).
By default, the component will emit the events in the body and `CamelDebeziumBefore` header as https://kafka.apache.org/22/javadoc/org/apache/kafka/connect/data/Struct.html[`Struct`] data type, the reasoning behind this, is to perceive the schema information in case is needed.
-However, the component as well contains a xref:manual::type-converter.adoc[Type Converter] that converts from
+However, the component as well contains a xref:manual::type-converter.adoc[Type Converter] that converts
from default output type of https://kafka.apache.org/22/javadoc/org/apache/kafka/connect/data/Struct.html[`Struct`] to `Map` in order to leverage Camel's rich xref:manual::data-format.adoc[Data Format] types which many of them work out of box with `Map` data type.
To use it, you can either add `Map.class` type when you access the message e.g: `exchange.getIn().getBody(Map.class)`, or you can convert the body always to `Map` from the route builder by adding `.convertBodyTo(Map.class)` to your Camel Route DSL after `from` statement.