{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$id" : "https://voltdb.com/voltsp/schemas/sink/kafka",
  "title" : "Kafka Sink Configuration",
  "description" : "The `kafka` sink sends data to an Apache Kafka topic. It supports a variety of configurations such as specifying\n the topic name, bootstrap servers, key and value serializers, SSL configuration, and more.\n This sink is ideal for integrating with Kafka for real-time data streaming.\n",
  "type" : "object",
  "properties" : {
    "kafka" : {
      "type" : "object",
      "properties" : {
        "bootstrapServers" : {
          "description" : "A list of host/port pairs used to establish the initial connection to the Kafka cluster.\nClients use this list to bootstrap and discover the full set of Kafka brokers.",
          "anyOf" : [ {
            "type" : "string"
          }, {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          } ]
        },
        "topicName" : {
          "type" : "string",
          "description" : "Sets the Kafka topic name where data will be sent."
        },
        "properties" : {
          "type" : "object",
          "description" : "Adds or overrides a specific Kafka client property, allowing customization for advanced configurations.",
          "additionalProperties" : {
            "type" : "string"
          }
        },
        "ssl" : {
          "type" : "object",
          "description" : "SSL configuration.",
          "properties" : {
            "trustStoreFile" : {
              "type" : "string",
              "description" : "Truststore file or trusted CA certificate; supported formats include JKS, PKCS#12, or PEM."
            },
            "trustStorePassword" : {
              "type" : "string",
              "description" : "Truststore password."
            },
            "keyStoreFile" : {
              "type" : "string",
              "description" : "Keystore file; supported formats include JKS, PKCS#12, or PEM"
            },
            "keyStorePassword" : {
              "type" : "string",
              "description" : "Keystore password."
            },
            "keyPassword" : {
              "type" : "string",
              "description" : "Private key password. Optional — if not set, the key store password will be used."
            },
            "insecure" : {
              "type" : "boolean",
              "description" : "If set to true, disables SSL certificate and hostname validation.\nIntended for debugging purposes only. Doesn't work with mTLS.\n"
            },
            "hostnameVerifier" : {
              "type" : "string",
              "description" : "Custom hostname verifier for SSL connections.\nIf not specified and 'insecure' is true, hostname verification will be disabled.\n"
            }
          },
          "additionalProperties" : false
        },
        "keySerializer" : {
          "type" : "string",
          "description" : "Kafka key deserializer",
          "default" : "org.apache.kafka.common.serialization.StringSerializer"
        },
        "valueSerializer" : {
          "type" : "string",
          "description" : "Kafka value deserializer"
        },
        "exceptionHandler" : {
          "type" : "string",
          "description" : "Custom exception handler enabling interception of all errors related to this sink."
        },
        "keyExtractor" : {
          "type" : "string",
          "description" : "A function that extracts the message key from the given output object.\nThe extracted key is used by Kafka for partitioning and message ordering within a topic."
        },
        "valueExtractor" : {
          "type" : "string",
          "description" : "A function that extracts the message value (payload) from the output object.\nThis is the core content of the Kafka message."
        },
        "headerExtractor" : {
          "type" : "string",
          "description" : "A function that extracts Kafka headers from the output object.\nHeaders can carry metadata or additional context alongside the message and are represented\nas key-value pairs (Header objects)."
        },
        "schemaRegistryUrl" : {
          "type" : "string",
          "description" : "Schema registry URL"
        }
      },
      "required" : [ "bootstrapServers", "topicName", "keySerializer", "valueSerializer" ],
      "additionalProperties" : false
    }
  },
  "required" : [ "kafka" ],
  "additionalProperties" : false
}
