Comment on page
Example
The following examples can be found on this page:
This example demonstrates how to use the Listener to return temperature readings from an MQTT broker using minimal configuration. It is designed to work with the MQTT Action Agent Basic Settings Example.
Drag the MQTT Listener onto the canvas and rename it. Link the output endpoint to the printer and save the Data Stream.

Select the Agent and click Configure. In this case, keep the default Collection.

Fill in the broker address of your MQTT broker and the topic to listen for. In this case, tick to use variables, and select a broker address and topic.

Fill in the payload definition. In this case, leave the payload format default and enter the following properties:
- Temperature, Double
- Timestamp, DateTime

Apply the changes, save the Data Stream, and publish it.

Let's look at the Live Data View. Make sure the MQTT Action Agent Basic Settings Example is also published.
Observe that any new temperature readings published by the MQTT Action Agent for the specified topic are printed by the Listener.

File | Link | Security Key |
---|---|---|
Data Stream | MQTT Listener Example.xuc | C0mp|ex123 |
This example demonstrates how to use the Listener to return temperature readings from an MQTT broker using advanced configuration.
Drag the MQTT Listener onto the canvas and rename it. Link the output endpoint to the printer and save the Data Stream.

Select the Agent and click Configure. In this case, keep the default Collection.

Fill in the broker address of your MQTT broker and the topic to listen for. In this case, tick to use variables, select a broker address and topic and leave clean session ticked.
Tick the advanced settings to show more configuration options.

Enter the port and QoS option. In this example, select your port and keep the default QoS (Exactly Once).

Tick the secure channel if you want to enable TLS/SSL channel communication and enter the channel details.
In this case, keep the default protocol (TSL v1.2), upload both the root and client certificates and select the client certificate password.

Enter the authentication details: username and password.

Fill in the payload definition. In this case, leave the payload format default and enter the following properties:
- Temperature, Double
- Timestamp, DateTime

Apply the changes, save the Data Stream, and publish it.

Let's look at the Live Data View. Observe that any new temperature readings published to the MQTT broker for the specified topic are printed.

File | Link | Security Key |
---|---|---|
Data Stream | MQTT Listener Example 2.xuc | C0mp|ex123 |
Last modified 8mo ago