DBZ-4012 Deprecate/Rename debezium namespace config options

This commit is contained in:
Chris Cranford 2021-11-11 14:26:37 -05:00 committed by Gunnar Morling
parent 7a4140c6aa
commit 970792bc40
5 changed files with 62 additions and 37 deletions

View File

@ -116,15 +116,11 @@ public static ConfigDef configDef() {
config,
"Collection",
FIELD_EVENT_ID, FIELD_EVENT_KEY, FIELD_EVENT_TYPE, FIELD_PAYLOAD, FIELD_PAYLOAD_ID, FIELD_EVENT_TIMESTAMP, FIELDS_ADDITIONAL_PLACEMENT,
FIELD_SCHEMA_VERSION);
FIELD_SCHEMA_VERSION, OPERATION_INVALID_BEHAVIOR, EXPAND_JSON_PAYLOAD);
Field.group(
config,
"Router",
ROUTE_BY_FIELD, ROUTE_TOPIC_REGEX, ROUTE_TOPIC_REPLACEMENT, ROUTE_TOMBSTONE_ON_EMPTY_PAYLOAD);
Field.group(
config,
"Debezium",
OPERATION_INVALID_BEHAVIOR, EXPAND_JSON_PAYLOAD);
Field.group(
config,
"Tracing",

View File

@ -117,6 +117,15 @@ public String getAlias() {
}
}
public static final Field OPERATION_INVALID_BEHAVIOR = Field.create("table.op.invalid.behavior")
.withDisplayName("Behavior when the route fails to apply")
.withEnum(InvalidOperationBehavior.class, InvalidOperationBehavior.SKIP_AND_WARN)
.withWidth(ConfigDef.Width.MEDIUM)
.withImportance(ConfigDef.Importance.MEDIUM)
.withDescription("While Debezium is monitoring the table, it's expecting only to see 'create' row events," +
" in case something else is processed this transform can log it as warning, error or stop the" +
" process.");
public static final Field FIELD_EVENT_ID = Field.create("table.field.event.id")
.withDisplayName("Event ID Field")
.withType(ConfigDef.Type.STRING)
@ -218,16 +227,17 @@ public String getAlias() {
.withImportance(ConfigDef.Importance.HIGH)
.withDescription("Whether or not an empty payload should cause a tombstone event.");
public static final Field OPERATION_INVALID_BEHAVIOR = Field.create("debezium.op.invalid.behavior")
@Deprecated
public static final Field DEBEZIUM_OPERATION_INVALID_BEHAVIOR = Field.create("debezium.op.invalid.behavior")
.withDisplayName("Behavior when the route fails to apply")
.withEnum(InvalidOperationBehavior.class, InvalidOperationBehavior.SKIP_AND_WARN)
.withWidth(ConfigDef.Width.MEDIUM)
.withImportance(ConfigDef.Importance.MEDIUM)
.withDescription("While Debezium is monitoring the table, it's expecting only to see 'create' row events," +
" in case something else is processed this transform can log it as warning, error or stop the" +
" process");
" process. This option is deprecated, use 'table.op.invalid.behavior' instead.");
public static final Field EXPAND_JSON_PAYLOAD = Field.create("debezium.expand.json.payload")
public static final Field EXPAND_JSON_PAYLOAD = Field.create("table.expand.json.payload")
.withDisplayName("Expand Payload escaped string as real JSON")
.withType(ConfigDef.Type.BOOLEAN)
.withDefault(false)
@ -250,6 +260,7 @@ public String getAlias() {
ROUTE_TOPIC_REGEX,
ROUTE_TOPIC_REPLACEMENT,
ROUTE_TOMBSTONE_ON_EMPTY_PAYLOAD,
DEBEZIUM_OPERATION_INVALID_BEHAVIOR,
OPERATION_INVALID_BEHAVIOR,
EXPAND_JSON_PAYLOAD
};
@ -268,7 +279,7 @@ public static ConfigDef configDef() {
config,
"Table",
FIELD_EVENT_ID, FIELD_EVENT_KEY, FIELD_EVENT_TYPE, FIELD_PAYLOAD, FIELD_PAYLOAD_ID, FIELD_EVENT_TIMESTAMP, FIELDS_ADDITIONAL_PLACEMENT,
FIELD_SCHEMA_VERSION);
FIELD_SCHEMA_VERSION, OPERATION_INVALID_BEHAVIOR, EXPAND_JSON_PAYLOAD);
Field.group(
config,
"Router",
@ -276,7 +287,7 @@ public static ConfigDef configDef() {
Field.group(
config,
"Debezium",
OPERATION_INVALID_BEHAVIOR, EXPAND_JSON_PAYLOAD);
DEBEZIUM_OPERATION_INVALID_BEHAVIOR);
Field.group(
config,
"Tracing",

View File

@ -318,7 +318,8 @@ public void configure(Map<String, ?> configMap) {
}
invalidOperationBehavior = EventRouterConfigDefinition.InvalidOperationBehavior.parse(
config.getString(EventRouterConfigDefinition.OPERATION_INVALID_BEHAVIOR));
config.getFallbackStringPropertyWithWarning(EventRouterConfigDefinition.OPERATION_INVALID_BEHAVIOR,
EventRouterConfigDefinition.DEBEZIUM_OPERATION_INVALID_BEHAVIOR));
expandJsonPayload = config.getBoolean(EventRouterConfigDefinition.EXPAND_JSON_PAYLOAD);
if (expandJsonPayload) {

View File

@ -297,13 +297,13 @@ being deduced from the JSON document itself. That way the result in Kafka messag
}
----
To enable this transformation, you have to set the `debezium.expand.json.payload` to true like below:
To enable this transformation, you have to set the `collection.expand.json.payload` to true like below:
[source]
----
transforms=outbox,...
transforms.outbox.type=io.debezium.connector.mongodb.transforms.outbox.MongoEventRouter
transforms.outbox.debezium.expand.json.payload=true
transforms.outbox.collection.expand.json.payload=true
----
// Type: reference
@ -322,6 +322,18 @@ The following table describes the options that you can specify for the outbox ev
|Group
|Description
|[[mongodb-outbox-event-router-property-collection-op-invalid-behavior]]<<mongodb-outbox-event-router-property-collection-op-invalid-behavior, `collection.op.invalid.behavior`>>
|`warn`
|Collection
a|Determines the behavior of the SMT when there is an `UPDATE` operation on the outbox collection. Possible settings are:
* `warn` - The SMT logs a warning and continues to the next outbox collection document.
* `error` - The SMT logs an error and continues to the next outbox collection document.
* `fatal` - The SMT logs an error and the connector stops processing.
All changes in an outbox collection are expected to be `INSERT` operations. That is, an outbox collection functions as a queue; updates to documents in an outbox collection are not allowed.
The SMT automatically filters out `DELETE` operations on an outbox collection.
|[[mongodb-outbox-event-router-property-collection-field-event-id]]<<mongodb-outbox-event-router-property-collection-field-event-id, `collection.field.event.id`>>
|`_id`
|Collection
@ -347,6 +359,11 @@ The following table describes the options that you can specify for the outbox ev
|Collection
|Specifies the outbox collection field that contains the payload ID.
|[[mongodb-outbox-event-router-property-collection-expand-json-payload]]<<mongodb-outbox-event-router-property-collection-expand-json-payload, `collection.expand.json.payload`>>
|`false`
|Collection
a|Specifies whether the JSON expansion of a String payload should be done. If no content found or in case of parsing error, the content is kept "as is".
|[[mongodb-outbox-event-router-property-collection-fields-additional-placement]]<<mongodb-outbox-event-router-property-collection-fields-additional-placement, `collection.fields.additional.placement`>>
|
|Collection, Envelope
@ -395,23 +412,6 @@ To change the topic name, you can: +
|Router
|Indicates whether an empty or `null` payload causes the connector to emit a tombstone event.
|[[mongodb-outbox-event-router-property-debezium-op-invalid-behavior]]<<mongodb-outbox-event-router-property-debezium-op-invalid-behavior, `debezium.op.invalid.behavior`>>
|`warn`
|{prodname}
a|Determines the behavior of the SMT when there is an `UPDATE` operation on the outbox collection. Possible settings are:
* `warn` - The SMT logs a warning and continues to the next outbox collection document.
* `error` - The SMT logs an error and continues to the next outbox collection document.
* `fatal` - The SMT logs an error and the connector stops processing.
All changes in an outbox collection are expected to be `INSERT` operations. That is, an outbox collection functions as a queue; updates to documents in an outbox collection are not allowed.
The SMT automatically filters out `DELETE` operations on an outbox collection.
|[[mongodb-outbox-event-router-property-debezium-expand-json-payload]]<<mongodb-outbox-event-router-property-debezium-expand-json-payload, `debezium.expand.json.payload`>>
|`false`
|{prodname}
a| Indicates whether the JSON expansion of a String payload should be done. If no content found or in case of parsing error, the content is kept "as is".
ifdef::community[]
|[[mongodb-outbox-event-router-property-tracing-span-context-field]]<<mongodb-outbox-event-router-property-tracing-span-context-field, `tracing.span.context.field`>>
|`tracingspancontext`

View File

@ -298,13 +298,13 @@ being deduced from the JSON document itself. That way the result in Kafka messag
}
----
To enable this transformation, you have to set the xref:outbox-event-router-property-debezium-expand-json-payload[`debezium.expand.json.payload`] to true like below:
To enable this transformation, you have to set the xref:outbox-event-router-property-table-expand-json-payload[`table.expand.json.payload`] to true like below:
[source]
----
transforms=outbox,...
transforms.outbox.type=io.debezium.transforms.outbox.EventRouter
transforms.outbox.debezium.expand.json.payload=true
transforms.outbox.table.expand.json.payload=true
----
// Type: reference
@ -323,6 +323,18 @@ The following table describes the options that you can specify for the outbox ev
|Group
|Description
|[[outbox-event-router-property-table-op-invalid-behavior]]<<outbox-event-router-property-table-op-invalid-behavior, `table.op.invalid.behavior`>>
|`warn`
|Table
a|Determines the behavior of the SMT when there is an `UPDATE` operation on the outbox table. Possible settings are:
* `warn` - The SMT logs a warning and continues to the next outbox table record.
* `error` - The SMT logs an error and continues to the next outbox table record.
* `fatal` - The SMT logs an error and the connector stops processing.
All changes in an outbox table are expected to be `INSERT` operations. That is, an outbox table functions as a queue; updates to records in an outbox table are not allowed.
The SMT automatically filters out `DELETE` operations on an outbox table.
|[[outbox-event-router-property-table-field-event-id]]<<outbox-event-router-property-table-field-event-id, `table.field.event.id`>>
|`id`
|Table
@ -348,6 +360,11 @@ The following table describes the options that you can specify for the outbox ev
|Table
|Specifies the outbox table column that contains the payload ID.
|[[outbox-event-router-property-table-expand-json-payload]]<<outbox-event-router-property-table-expand-json-payload, `table.expand.json.payload`>>
|`false`
|Table
a|Specifies whether the JSON expansion of a String payload should be done. If no content found or in case of parsing error, the content is kept "as is".
|[[outbox-event-router-property-table-fields-additional-placement]]<<outbox-event-router-property-table-fields-additional-placement, `table.fields.additional.placement`>>
|
|Table, Envelope
@ -396,7 +413,9 @@ To change the topic name, you can: +
|Router
|Indicates whether an empty or `null` payload causes the connector to emit a tombstone event.
|[[outbox-event-router-property-debezium-op-invalid-behavior]]<<outbox-event-router-property-debezium-op-invalid-behavior, `debezium.op.invalid.behavior`>>
ifdef::community[]
|[[outbox-event-router-property-debezium-op-invalid-behavior]]<<outbox-event-router-property-debezium-op-invalid-behavior, `debezium.op.invalid.behavior`>> +
_Deprecated_
|`warn`
|{prodname}
a|Determines the behavior of the SMT when there is an `UPDATE` operation on the outbox table. Possible settings are:
@ -408,10 +427,8 @@ a|Determines the behavior of the SMT when there is an `UPDATE` operation on the
All changes in an outbox table are expected to be `INSERT` operations. That is, an outbox table functions as a queue; updates to records in an outbox table are not allowed.
The SMT automatically filters out `DELETE` operations on an outbox table.
|[[outbox-event-router-property-debezium-expand-json-payload]]<<outbox-event-router-property-debezium-expand-json-payload, `debezium.expand.json.payload`>>
|`false`
|{prodname}
a| Indicates whether the JSON expansion of a String payload should be done. If no content found or in case of parsing error, the content is kept "as is".
_Use xref:outbox-event-router-property-table-op-invalid-behavior[`table.op.invalid.behavior`] instead_.
endif::community[]
ifdef::community[]
|[[outbox-event-router-property-tracing-span-context-field]]<<outbox-event-router-property-tracing-span-context-field, `tracing.span.context.field`>>