VILLASframework
Modular co-simulation framework
Kafka Schema/Payload Javascript Object Notation

Implementation

The source code of the format-type is available here: https://git.rwth-aachen.de/acs/public/villas/node/-/blob/master/lib/formats/json_kafka.cpp

Configuration

The Kafka Schema/Payload Javascript Object Notation format-type supports all configuration options of the Javascript Object Notation format-type plus the following:

schema (object)

Example Configuration

nodes = {
node = {
type = "file"
uri = "/dev/null"
format = {
type = "json.kafka"
indent = 2
schema = {
type = "struct"
name = "villas-node.Value"
}
}
}
}

Example Payload

{
"schema": {
"type": "struct",
"name": "villas-node.Value",
"fields": [
{
"type": "int64",
"optional": false,
"field": "timestamp"
},
{
"type": "int64",
"optional": false,
"field": "sequence"
},
{
"type": "double",
"optional": false,
"field": "signal0"
}
]
},
"payload": {
"timestamp": 1623834103174,
"sequence": 7,
"signal0": -0.95122443954003999
}
}