Publish method

Publishes an MQTT message.
Syntax
retCode
=
mqttClient
.
Publish
(message As
MQTTMessage
)
where
retCode
- is a constant of the MqttPublishCode object.
mqttClient
- is an MQTTClient object created by the MQTTFactory object's method
CreateClient
.
Example
Dim retCode As MqttPublishCode Dim msg As MQTTMessage Dim data() As Byte Set msg = MqttFactory.CreateApplicationMessage() msg.PayloadFormat = MqttPayloadCharacter msg.contenttype = "String" msg.Topic = "Topic" msg.payload = "This is the msg text." msg.SubscriptionIdentifiers = CLng(1) data = StrConv("This is the correlation.", vbFromUnicode) msg.correlation = data msg.ResponseTopic = "This is the response topic." msg.AddUserProperty "Head1", "Node1" msg.QoS = MqttQoS2 retCode = mqttClient.Publish(msg)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal