-
Sub-task
-
Resolution: Done
-
Major
-
None
-
False
-
-
False
-
-
Context
Debezium emits change events (INSERT, UPDATE, DELETE) in a generic form via the ChangeEvent<K, V> interface. Traditionally, developers must manually filter, parse, and handle events by inspecting the topic name or event payload to identify the table of origin. Quarkus developers expect the ability to listen for change events from specific tables using annotations — similar to how message consumers are declared in Quarkus Kafka or REST endpoints in JAX-RS.
Decision
Introduce CDI-compatible annotation to declaratively register event consumers for specific tables:
- @Capturing() — for handling single events.
The extension will match the table name and dispatch relevant events to the appropriate annotated methods.
import io.debezium.engine.ChangeEvent; import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped class OrderListener { @Capturing() public void listener(ChangeEvent<SourceRecord> events) { /// some logic to apply } }
This enables Quarkus developers to write table and operation specific logic in a clean, declarative, and testable way.
Consequences
- Native support requires that all annotated listener classes be discoverable and registered for reflection.
- Developers gain precise control over which events to consume, improving separation of concerns and testability.
References:
Debezium Design Document: https://github.com/debezium/debezium-design-documents/pull/16