Use an MQTTPublish policy to control the value of specific MQ Telemetry Transport (MQTT) publishing properties at run time.
An MQTTPublish policy can be used to control the values of a specific set of MQTTPublish node properties, called operational properties, at run time. If a policy is attached to an MQTTPublish node, the property values that are specified in the policy are used at run time. These values override the property values that were specified when the message flow was developed. For information about which operational properties can be controlled by a MQTTPublish policy, see the MQTTPublish node reference topic.
You can also use the message flow view to retrieve and update a policy that is attached to a message flow node. In the navigation tree, expand Message Flows, and select the name of the message flow, or subflow, you want to view. Select the Operational Policy tab from the top of the message flow pane, and the message flow, or subflow, is displayed in the Node Policies section. If the message flow, or subflow, includes a node that has an operational policy attached, the following policy icon is displayed on the upper-right corner of the node icon: . Click the policy icon to retrieve and update the policy document.
For information about accessing the web UI, see Accessing the web user interface.
<policy type="MQTTPublish">
<policyProperties>
<description>
<shortDesc>Publish 01</shortDesc>
<longDesc>MQTT publish policy for blood pressure monitor</longDesc>
</description>
<basic>
<clientId>Pub_bloodpressure_1</clientId>
<topicName>Hypertension/Alert</topicName>
<hostName>localhost</hostName>
<port>1883</port>
<qos>0</qos>
</basic>
</policyProperties></policy>