Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1715

Add topic routing by field option for New Record State Extraction

    Details

      Description

      Currently the New Record State Extraction doesn't support the option of routing based on a certain field from the table. For my current use case I'd need to set a topic based on a varchar field in the table.

      My first attempt was combining ExtractTopic SMT (https://docs.confluent.io/current/connect/transforms/extracttopic.html) with Debezium. This works nicely, except for delete as the `after` struct is null and the SMT fails because it can't set the topic. In case of delete, you'll need to use the field value from the `before` struct while in create / update the `after` struct should be used.

      So my next option was expending the SMT. Based on the existing code for the Outbox Event Router SMT I've added a few lines of code to the SMT which take care of routing for CREATE, UPDATE and DELETE events.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jhuiting Jos Huiting
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: