apiVersion: v1
kind: ConfigMap
metadata:
  name: customers-jdbc-source-connector
  labels:
    destination: connect
    enabled: "true"
data:
  customers-jdbc-source-connector.json: |-
    {
      "name": "jdbc-customers",
      "config": {
        "name": "jdbc-customers",
        "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
        "connection.url": "jdbc:mysql://mysql:3306",
        "connection.user": env.MYSQL_CONNECTION_USER,
        "connection.password": env.MYSQL_CONNECTION_PASSWORD,
        "mode": "incrementing",
        "incrementing.column.name": "id",
        "topic.prefix": "",
        "table.whitelist": "customers",
        "key.converter": "org.apache.kafka.connect.converters.LongConverter",
        "key.converter.schemas.enable": "false",
        "value.converter": "io.confluent.connect.avro.AvroConverter",
        "value.converter.schema.registry.url": $SCHEMA_REGISTRY_URL,
        "value.converter.basic.auth.credentials.source": $BASIC_AUTH_CREDENTIALS_SOURCE,
        "value.converter.schema.registry.basic.auth.user.info": $SCHEMA_REGISTRY_BASIC_AUTH_USER_INFO,
        "transforms": "InsertKey, ExtractId, CastLong, SetValueSchema",
        "transforms.InsertKey.type": "org.apache.kafka.connect.transforms.ValueToKey",
        "transforms.InsertKey.fields": "id",
        "transforms.ExtractId.type": "org.apache.kafka.connect.transforms.ExtractField$Key",
        "transforms.ExtractId.field": "id",
        "transforms.CastLong.type": "org.apache.kafka.connect.transforms.Cast$Key",
        "transforms.CastLong.spec": "int64",
        "transforms.SetValueSchema.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Value",
        "transforms.SetValueSchema.schema.name": "io.confluent.examples.streams.avro.microservices.Customer",
        "transforms.SetValueSchema.schema.version": "4",
        "tasks.max": "2"
      }
    }

