debezium/dbz#1081 add capturing filter strategy for single event processing#55
Conversation
Good question. |
| */ | ||
| @Suite | ||
| @SelectClasses({ CapturingTest.class, DebeziumLifeCycleTest.class, HeartbeatTest.class, NotificationTest.class, PostProcessingTest.class, CustomConverterTest.class, | ||
| @SelectClasses({ CapturingTest.class, CapturingFilterTest.class, CapturingFieldsFilterTest.class, CapturingFilterValidationTest.class, DebeziumLifeCycleTest.class, |
There was a problem hiding this comment.
CapturingFilterTest and CapturingFieldsFilterTest aren't available for NoSql database?
There was a problem hiding this comment.
I missed it in NoSql test suite. Good catch
0e86c5e to
cb32e56
Compare
…essing Signed-off-by: vsantonastaso <vsantonastaso.dev@gmail.com>
|
Just added logic into CapturingFieldsFilterStrategy for noSql connector (handle json payload in addition to Struct ones) |
closes debezium/dbz#1081
Context
This PR introduces a pluggable
CapturingFilterStrategyfor the@Capturingannotation for user-defined filtering mechanism.Users can implement custom filters that receive the full
CapturingEvent<SourceRecord, SourceRecord>and decide whether to capture each event.Changes
The
@Capturingannotation now supports afilterattribute:The filter attribute is mutually exclusive with destination and engine with a build time validaition.
A dedicated filter registry handles filter-based invokers separately from destination-based ones. Events are dispatched through a fallback chain: filter registry first, then object invoker with deserializer, then default registry (destination match + all destination fallback).
A built-in CapturingFieldsFilterStrategy abstract class is provided for field-based filtering:
This captures only events that impact the specified fields. In particular, for Create/Read event, checks if the field exists in the schema, For Update event checks if the field value changed, For Delete one checks if the field existed, Truncate/Message events are rejected.
Documentation
updated with debezium/debezium#7494