Поток трансформации c БД#

Database Transformation.png

Пример потока трансформации с БД:

{
  flow: {
    name: "JobName"
    source: [${source}]
  }

  source: {
    name: "simple transformation"
    type: "source"
    topic: "input"
    config: ${defaults.kafka} {
      consumer: {
        "group.id": "event-process-flow-group"
        "client.id": "event-process-flow-client"
      }
      producer: {
        "client.id": "event-process-flow-producer"
      }
    }
    destination: ${transformStep}
  }

  transformStep: {
    name: "transformation"
    type: "dsl"
    format: {
      input: "json"
      output: "json"
    }
    dsl: {
      source: "file"
      path: "event.tr"
    }
    database: {
      config: {
        type: "database"
        url: "jdbc:postgresql://127.0.0.1:19093/test"
        driver: "org.postgresql.Driver"
        databaseName: "test"
        props: {
          user: "test"
          password: "test"
        }
        statements: {
            "dropTable": "DROP TABLE IF EXISTS users;"
            "createTable": "CREATE TABLE users(ID SERIAL PRIMARY KEY, EMAIL VARCHAR(255) NOT NULL, PASSWORD VARCHAR(255) NOT NULL);"
            "insertUsers": "INSERT INTO users (email, password) VALUES (?, ?);"
            "selectAllUsers": "select * from users;"
            "deleteAllUsers": "delete from users;"
        }
      }
    }
    destination: ${destination}
  }

  destination: {
    name: "output"
    type: "destination"
    topic: "output"
    config: ${defaults.kafka}
  }
}