Streams
The stream processing feature allows messages with JSON payloads to be modified before they are republished and/or persisted to disk. This is managed with a user defined query that has similar concepts to a SQL statement.
The Cedalo Stream Processing (CSP) plugin allows the creation of topic streams in the Mosquitto broker. A topic stream receives all messages on a specified topic and can then perform the following tasks:
- Republish messages on a different topic, with optional QoS and retain control
- Persist messages to disk, with the ability to replay messages in the future
- Process JSON payload to extract particular data values prior to republishing
- Apply aggregation functions to data prior to republishing/persisting
- Select which messages are processed/persisted based on data values in the payload
Depending on your deployment, the streams feature might need to be configured. Visit Setting up Streams for more information on that.
Essential for a stream definition is the Stream Query. It defines, how a stream is processing a topic. The syntax for the Stream Query is described in Select Query Syntax. This section describes the JSON-Format for a query to execute the tasks listed above.
The Streams Web Client describes, how you manage Streams within the Cedalo MQTT Platform Web Client.
In Addition, you can modify streams by using the MQTT API or REST API. Please visit the API Section for more infos.