debezium:
  source:
    connector:
      class: io.debezium.connector.oracle.OracleConnector
    offset:
      storage:
        ~: io.debezium.storage.jdbc.offset.JdbcOffsetBackingStore
        jdbc:
          table:
            name: debezium_offset_storage_totvs
          # connection:
          #   url: <FROM_ENV>

    schema:
      include:
        list: C##SVC_MDM,TOTALBANCO_BASICO
      history:
        internal:
          ~: io.debezium.storage.jdbc.history.JdbcSchemaHistory
          # We don't care about ddl, so set this to true on unparseable issues
          skip:
            unparseable:
              ddl: false
          jdbc:
            table:
              name: debezium_schema_history_totvs
            # connection:
            #   url: <FROM_ENV>
          store:
            only:
              captured:
                tables:
                  ddl: true
                databases:
                  ddl: true

    key:
      converter:
        schemas:
          enable: false
    value:
      converter:
        schemas:
          enable: false

    skip:
      messages:
        without:
          change: true
    include:
      schema:
        changes: false

    database:
      connection:
        adapter: logminer
      # hostname: <FROM_ENV>
      # port: <FROM_ENV>
      # user: <FROM_ENV>
      # password: <FROM_ENV>
      # dbname: <FROM_ENV>
      # pdb.name: <FROM_ENV>
    topic:
      prefix: 'oracle-totvs'

    snapshot:
      mode: no_data

    table:
      include:
        list: |
          list
    column:
      include:
        list: |
          list

    # Not using compaction, so we can set this to false
    tombstones:
      'on':
        delete: false

    message:
      key:
        columns: |
          columns

    heartbeat:
      interval:
        ms: 60000
      action:
        query: "UPDATE C##SVC_MDM.DEBEZIUM_HEARTBEAT SET beat=DBMS_RANDOM.VALUE WHERE id=1"

    log:
      mining:
        strategy: hybrid
        query:
          filter:
            mode: in
        session:
          max:
            ms: 900000
        restart:
          connection: true
        flush:
          table:
            name: C##SVC_MDM.DEBEZIUM_LOG_MINING_FLUSH
        transaction:
          retention:
            ms: 900000

    archive:
      destination:
        name: LOG_ARCHIVE_DEST_4

    skipped:
      operations: t
  sink:
    type: eventhubs
    eventhubs:
      hubname: evh-debezium-cdc-totvs
      maxbatchsize: 16384
      # connectionstring: <FROM_ENV>
    # type: kafka
    # kafka:
    #   producer:
    #     security:
    #       protocol: SASL_SSL
    #     sasl:
    #       mechanism: PLAIN
          # jaas:
          #   config: <FROM_ENV>
        # group:
        #   id: debezium-server-totvs
        # session:
        #   timeout:
        #     ms: 60000
        # key:
        #   serializer: org.apache.kafka.common.serialization.StringSerializer
        # value:
        #   serializer: org.apache.kafka.common.serialization.StringSerializer
        # bootstrap:
        #   servers: <FROM_ENV>

  transforms:
    ~: renamekeyCdCliUnc,renamekeyCdCliCre
    renamekeyCdCliUnc:
      type: org.apache.kafka.connect.transforms.ReplaceField$Key
      renames: CD_CLI_UNC:CD_CLI
      predicate: is_cd_cli_unc_table
    renamekeyCdCliCre:
      type: org.apache.kafka.connect.transforms.ReplaceField$Key
      renames: CD_CLI_CRE:CD_CLI
      predicate: is_cd_cli_cre_table
    # reroute:
    #   type: org.apache.kafka.connect.transforms.RegexRouter
    #   regex: '.*'
    #   replacement: evh-debezium-cdc-totvs

  predicates:
    ~: is_cd_cli_unc_table,is_cd_cli_cre_table
    is_cd_cli_unc_table:
      type: org.apache.kafka.connect.transforms.predicates.TopicNameMatches
      pattern: ".*pattern.*"
    is_cd_cli_cre_table:
      type: org.apache.kafka.connect.transforms.predicates.TopicNameMatches
      pattern: ".*pattern.*"


quarkus:
  http:
    port: 8080
  log:
    # level: <FROM_ENV>
    console:
      json: true
