Native MQTT support
Available since version 5.0.0-Renegade.
User Interface: 5.3.1-Ultimate
Introduction
Since version 5.0.0.0 we started to support the MQTT protocol natively, i.e. we allow communication through MQTT topics with the Platform security.
Until now, the Platform Digital Broker only supported MQTT through the embedded MQTT Broker, accessed through our SSAP messaging protocol that masks the base protocol (REST, WebSockets, MQTT, etc.).
How to use it
Platform Configuration
The first step is to create an Entity, or modify an existing entity, to enable the option of creating an MQTT topic.
To do so, we will have to navigate to the "Advanced Settings" tab and select the option "Allows to create an MQTT ingest topic for the Entity".
When selecting this option, a text box will be enabled so that we can customize the MQTT topic, where the name of the Entity will be automatically added at the end.
Once this option is enabled, the next step will consist of creating a Digital Client, to which we will give permissions over this Entity -at least in writing- to be able to insert data through the topic we have just created.
MQTT client configuration
When connecting the MQTT client, it is necessary to configure the user and password that will correspond to the Digital Client identifier and the token that we have defined in the Platform.
Once the client is connected, we will be able to:
Publish messages in the topic associated to the Entity: it must be taken into account that the message to be published must be in JSON format and comply with the schema of the Entity, otherwise the data will not be stored.
Subscribe to the topic /<entity_topic>/<client_id>: since in this topic, the Platform will publish the answers to the publications:
If the data has been inserted correctly, the ID of the data inserted in the Entity will be returned through this topic.
If there has been some kind of error in the insertion, the corresponding error message will be returned through this topic.
The following is a brief example of how an MQTT client would look like with the configuration described above.
Â