-
Sub-task
-
Resolution: Done
-
Major
-
None
-
False
-
-
False
-
-
Context
Debezium Embedded Engine supports a PostProcessor interface that allows developers to manipulate or transform change events before they are dispatched to the application via the .notifying() callback.
This mechanism is useful for:
- Filtering or modifying event payloads
- Injecting metadata
- Performing lightweight enrichment or data cleansing
To provide a consistent developer experience and support advanced transformation needs, the Quarkus extension should expose this capability via an annotation-based handler.
Decision
Introduce a CDI-compatible annotation: @DebeziumPostProcessor.
This annotation identifies a method that should be invoked as a post-processing step for each change event emitted by the engine. The method must accept the event key and value as parameters.
Example:
import io.debezium.engine.InsertEvent; import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped class CustomPostProcessor { @DebeziumPostProcessor() public void process(Object key, Struct value) { /// some logic to apply } }
Consequences
- The extension must intercept and register a post-processor during engine configuration.
- The annotated method must be discovered at build time and invoked at runtime with proper parameter binding.
- Only one post-processor is supported per engine; multiple annotations must trigger a build-time validation error.
- The processor method must not throw exceptions; failures should be logged and suppressed.
References:
Debezium Design Document: https://github.com/debezium/debezium-design-documents/pull/16