Add and configure the dedicated MQTT Publisher
- Last UpdatedAug 28, 2024
- 7 minute read
Add a dedicated MQTT Publisher hierarchy
This is the preferred way to create a publisher so that you can independently start/stop the publisher whenever any configuration change in the publisher is required.
To add the publisher hierarchy, expand the MQTT Communication Driver node, right-click Configuration, and then select Add MQTT_PUBLISHER Connection.

Configuring the MQTT Broker
The configuration of the MQTT Broker for the MQTT Publisher is similar to the Broker of the MQTT Subscriber. Refer to the Add and configure an MQTT Broker connection section for more information on the MQTT Broker configuration.

Configuring the MQTT Publisher
The MQTT Publisher window is divided into three main parts. The left pane displays the list of devices, the middle pane displays the details of each device, and the right pane (Settings pane) displays the configuration options for the device. You can toggle the visibility of the Settings pane by selecting the Settings icon.
The following figure shows the MQTT Publisher screen:

Devices Pane (Left Pane)
The left pane displays a list of added devices under a gateway. At the top of the hierarchy, you can see the Gateway name, under which you can see the name of the devices.
Note: The Gateway also acts as a device. Hence, when you select the Gateway name, you can view the corresponding attributes in the middle pane. It is recommended to create your own device and not to use the Gateway as a device.

Add a device
-
Select the New icon present at the top of the hierarchy on the grey ribbon.
The newly added device appears at the end of the hierarchy, indicated as New in the blue color.
Delete a device
-
Select a device that you want to delete.
-
Select the Delete icon present at the top of the hierarchy on the grey ribbon or right-click and select Delete.
A message asking for confirmation to delete appears.
-
Select OK.
The selected device is deleted.
Note: Deleting a device is irreversible.
Add a duplicate device
-
Select a device of which you want to create a duplicate. The duplicated device will contain the same device settings and attributes bound in the duplicating device.
-
Select the Duplicate icon present at the top of the hierarchy on the grey ribbon or right-click and select Duplicate.
The duplicate device of the selected device is created.
Rename a device
-
Select a device that you want to rename.
-
Right-click and select Rename.
-
Type the required name.
Note: Only alphanumeric characters of maximum length 40 are allowed.
Attribute Details Pane (Middle Pane)
The middle pane displays the attribute details of each device in a tree view. It displays the main attributes of the Galaxies which are deployed in the Application Server. Use this pane to select the attributes whose data you want to publish.

Just-In-Time Browsing
To optimize the amount of data downloaded from the data source, the hierarchy tree
in the middle pane employs Just-In-Time browsing when displaying information in different
hierarchies. If you see the download icon
in the hierarchy, selecting it will download all its immediate child nodes and attributes,
when selection of attributes will only be possible on that hierarchy.
To achieve optimal performance in the display, please select only those hierarchies where you are interested to select attributes for the device.
Select the attributes
-
To select a single attribute, select the corresponding check box of the required attribute.
-
To select multiple attributes together, left-click and drag the mouse over the attributes that you want to select.
-
To select all the attributes under a node, select the corresponding parent node of the attributes that you want to select.
To undo and redo the selections, select the Undo and Redo buttons on the menu bar respectively. The menu bar also displays the number of selected attributes out of the total number of attributes available. You can also view the number of selected attributes inside the blue circle present next to the respective device.
The grey ribbon present on the top of the middle pane displays the name of the device that is selected. To save your changes, select the Save icon present at the right end of the grey ribbon.
Unselect the attributes
-
To unselect a single attribute, clear the check box of the required attribute.
-
To unselect multiple attributes together, left-click and drag the mouse over the attributes while holding the Shift key.
-
To unselect all the attributes under a node, clear the corresponding parent node of the attributes that you want to unselect.
To toggle the selection of attributes
To toggle the selection of attributes, left-click and drag the mouse over the attributes while holding the Ctrl key.
Settings Pane (Right Pane)
Use the settings pane to configure the Edge Gateway and Device connection. To view the settings pane, select the Settings icon present on the right end of the grey ribbon. To hide the Settings pane, select the Settings icon again.
If you select the Edge Gateway node the configuration options for the gateway are displayed. If you select any Device node, the configuration settings for the device are displayed.

Select the
icon to read the description of the parameter.
Configure the settings of the MQTT Publisher
-
In the Client ID field, enter a unique string of up to 100 characters to identify the MQTT connection. If this field is left blank, a random string is assigned while saving the settings. The client ID is used to uniquely identify a connection of the publisher to the broker. Each group must have a unique Client ID.
-
In the Group field, enter the name of the group with up to 100 characters. The newline, space, +, or # character is not allowed. All publishing items will be sent under this group name. The group name is used as a prefix in the MQTT topic name. For example, if the group name is Group1 and the Edge Gateway name is EG1, the published topic name will be Group1/EG1.
-
In the Message Format field, select either Sparkplug or JSON format that is used to publish data. For the format of the JSON data, refer to Chapter 3 MQTT item naming.
-
In the SCADA Host ID field, enter the unique ID that identifies the Primary Host/Application in the network. This permits the MQTT Publisher to respond to the STATE Online/Offline message published by the Primary Host to the MQTT Broker.
The value should be identical to the SCADA Host ID that was used during the MQTT Broker configuration. The value can be blank if you do not want the publisher to respond to the Sparkplug STATE Online/Offline message.
-
To keep the last published message at the broker, select the Retain last message check box.
-
Under the Quality of Service (QOS) field, select a level of Quality of Service (QoS). The QoS level determines message delivery parameters, with 0 as the lowest level of service, and 2 as the highest level.
-
At Most Once (0): The message will be delivered no more than one time, meaning that it may not be delivered. There is no backup of the message, and if the connection to the client is lost, the message will not be delivered. No delivery acknowledgment is provided.
-
At Least Once (1): The message will be delivered at least one time, but it may be delivered more than once if the sender does not receive an acknowledgment of successful transmission. The sender stores the message until a receipt acknowledgment is received.
-
Exactly Once (2): The message is delivered one time only. The sender stores the message until it receives confirmation of receipt. This is the safest, and slowest, message transfer mode.
-
-
To store and forward the data when the connection with the broker is lost, select the Enable Store and Forward checkbox. Once the connectivity is restored, the published data is forwarded to the broker.
Each MQTT group has a maximum Store and Forward cache size of 4 GB. Once this limit is reached, depending on the following selection, the data is discarded or the collection of data is stopped.
-
Wrap-around Data
If this option is selected, the oldest data stored in the cache is discarded to allow storage space for new data.
-
Stop Collecting
If this option is selected, the system ceases to collect and store any new data. Once the connection is established again, the stored files are forwarded, which reduces the cache size, allowing storage space for new data.
-
Note: MQTT publisher configuration is shared across all configuration sets archived from the original set. The changes in publisher configuration in any archive set are also reflected in all configuration sets archived from the original set. For more information on archiving the configuration sets, refer to the Archive configuration sets section of the AVEVA Communication Drivers Pack help.
Note: If the data source (that is, Galaxy in System Platform) contains a lot of objects and attributes, you may observe large memory consumption and latency when you interact with Publisher Configuration in the OCMC. Keeping the total number of attributes that you want to view in the Publisher to less than 5000 will improve the browsing experience in the Publisher Configuration in the OCMC.