Skip to main content

Generator configuration

kafkaValueProtobufHint

Commentary

added in 0.8.5

local configuration

When using the Kafka Protobuf serializer, explicitly defines the Protobuf schema and message for the record value.


Examples

Setting the schema

Set kafkaValueProtobufHint with two keys: schemaFile, which is a path inside the container to a file containing the Protobuf schema, and message, which is the Protobuf message to encode the record with.

{
"generators": [
{
"topic": "customers",
"value": {
"id": {
"_gen": "uuid"
}
},
"localConfigs": {
"kafkaValueProtobufHint": {
"schemaFile": "/path/to/protobuf-schema.proto",
"message": "UserIdentifier"
}
}
}
],
"connections": {
"kafka": {
"kind": "kafka",
"producerConfigs": {
"bootstrap.servers": "localhost:9092",
"key.serializer": "io.shadowtraffic.kafka.serdes.JsonSerializer",
"value.serializer": "io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer"
}
}
}
}

Specification

JSON schema

{
"type": "object",
"properties": {
"schemaFile": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"schemaFile",
"message"
]
}