R - the subtype of ConnectRecord on which this transformation will operatepublic class UnwrapFromEnvelope<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> extends Object implements org.apache.kafka.connect.transforms.Transformation<R>
Envelope) records that are struct of values containing values
before and after change. Sink connectors usually are not able to work
with a complex structure so a user use this SMT to extract after value and send it down
unwrapped in Envelope.
The functionality is similar to ExtractField SMT but has a special semantics for handling
delete events; when delete event is emitted by database then Debezium emits two messages: a delete
message and a tombstone message that serves as a signal to Kafka compaction process.
The SMT by default drops the tombstone message created by Debezium and converts the delete message into a tombstone message that can be dropped, too, if required.
| Modifier and Type | Class and Description |
|---|---|
static class |
UnwrapFromEnvelope.DeleteHandling |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
addOperationHeader |
private org.apache.kafka.connect.transforms.ExtractField<R> |
afterDelegate |
private org.apache.kafka.connect.transforms.ExtractField<R> |
beforeDelegate |
(package private) static String |
DEBEZIUM_OPERATION_HEADER_KEY |
private static String |
DELETED_FIELD |
private static Field |
DROP_DELETES |
private static Field |
DROP_TOMBSTONES |
private boolean |
dropDeletes |
private boolean |
dropTombstones |
private static String |
ENVELOPE_SCHEMA_NAME_SUFFIX |
private static Field |
HANDLE_DELETES |
private UnwrapFromEnvelope.DeleteHandling |
handleDeletes |
private org.slf4j.Logger |
logger |
private static Field |
OPERATION_HEADER |
private org.apache.kafka.connect.transforms.InsertField<R> |
removedDelegate |
private org.apache.kafka.connect.transforms.InsertField<R> |
updatedDelegate |
| Constructor and Description |
|---|
UnwrapFromEnvelope() |
| Modifier and Type | Method and Description |
|---|---|
R |
apply(R record) |
void |
close() |
org.apache.kafka.common.config.ConfigDef |
config() |
void |
configure(Map<String,?> configs) |
static final String DEBEZIUM_OPERATION_HEADER_KEY
private static final String ENVELOPE_SCHEMA_NAME_SUFFIX
private static final String DELETED_FIELD
private final org.slf4j.Logger logger
private static final Field DROP_TOMBSTONES
private static final Field DROP_DELETES
private static final Field HANDLE_DELETES
private static final Field OPERATION_HEADER
private boolean dropTombstones
private boolean dropDeletes
private UnwrapFromEnvelope.DeleteHandling handleDeletes
private boolean addOperationHeader
private final org.apache.kafka.connect.transforms.ExtractField<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> afterDelegate
private final org.apache.kafka.connect.transforms.ExtractField<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> beforeDelegate
private final org.apache.kafka.connect.transforms.InsertField<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> removedDelegate
Copyright © 2019 JBoss by Red Hat. All rights reserved.