Serialization
The Kafka connection acts as a “pass-through” connection. Key and message data is not transformed. Messages sent to a Kafka connection topic should be serialized messages that can be deserialized by the module.
For example, if a MSG module has a message implementation using JSON containing the following properties: “myMessageType”, “myStringStateChange”, “myIntegerStateChange”, and “timestamp” – using the kafka-console-producer.sh convenience script, you can send a message to a SOSS object with the following code:
$ bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic MyMsgModuleTopic --property "parse.key=true" --property "key.separator=|"
Instance_23|{"myMessageType":"initialMessage", "myStringStateChange":"initialMessage", "myIntegerStateChange":10, "timestamp":1561273200000}
Note
The Kafka connection requires messages within Kafka to specify a key. The key will be used as the identifier for the corresponding SOSS object.