def

func:mqttPublish

mqttPublish(conn, topic, payload, cfg: {})

Publish an MQTT message to the given topic on the broker. Currently, the payload of the message must be a Str.

The following configuration options are supported:

  • mqttQos: The quality-of-service to use for publishing the message. If not specified, then QoS 0 is used. See mqttQos.
  • mqttRetain: Should the message be retained on the broker (true | false). If not specified, then false is used. See mqttRetain.
  • mqttExpiryInterval: Sets the expiry interval for the message as a Duration. This is only supported in MQTT 5.
read(@mqttConn).mqttPublish("/test", "{a: a JSON object}", {mqttQos: 2})

meta

supertypes

feature

Feature namespace of definitions formatted as feature:name

    func

Axon function