Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-8902 Debezium Engine Quarkus Extension
  3. DBZ-8961

Debezium Engine Quarkus Extension: Introduce Debezium Capturing Listener

XMLWordPrintable

      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

              rh-ee-gpanice Giovanni Panice (Inactive)
              rh-ee-gpanice Giovanni Panice (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: