Skip to main content

Settings for the MQTT Adapter

Provides reference information for settings of the MQTT inbound and outbound adapters, EnsLib.MQTT.Adapter.Inbound and EnsLib.MQTT.Adapter.Outbound.

Summary

The MQTT adapters have the following settings:

The remaining settings are common to all business services. For information, see “Settings for All Business Services” in Configuring Productions.

Clean Session

Determines if the session to the broker will use a clean session.

Client ID

This is the string which identifies this client to the broker. It must be ASCII-encoded and between 1 and 23 characters.

If not specified the client will create a unique id.

Connect Timeout

This is the connect timeout. Connecting to a busy server may take some time and this timeout can be used to avoid a premature connection failure. Specifies the number of seconds to wait before a connection attempt fails.

Credentials Name

This is the ID name of the set of credentials values used to access the MQTT broker. The username and password defined in your Credentials item must be ASCII-encoded. Not required if the broker does not require login credentials.

Keep Alive

Specifies the maximum number of seconds that should be between messages from the client to the broker.

LWT Topic

This the LWT (Last Will and Testament) Topic. If specified must be ASCII-encoded. If the client disconnects due to an network error, the LWTMessage will be delivered to subscribers to the LWTTopic.

LWT Message

This is the LWT (Last Will and Testament) message. If specified must be ASCII-encoded.

QOS

This determines the quality of service required. It can have either of these two values:

  • 0 — QOSFireAndForget: Do not wait for a response from the broker.

  • 1 — QOSWaitForDelivery: Wait for a response from the broker and issue an error if the broker does not respond..

Retained

This is the flag that indicates to the broker whether the message should be retained by the broker.

SSL Config Name

This is the ID name of the TLS configuration that you wish to be used to communicate with the broker. Only used if TLS communication is required.

Note:

When using TLS, you must use an absolute path and not a relative path to the certificate file. For more information, see “Creating or Editing a TLS Configuration” in the Security Administration Guide.

Timeout

This is the timeout expressed in seconds to wait to send (with ack ) or receive a message.

Topic

This is the name of the topic to which you wish to publish or subscribe. The topic must be ASCII-encoded. The topic is typically a hierarchal string with levels of subtopics separated by a / (forward slash). In a subscription, a topic can have wildcards as a topic level:

  • + (plus sign) — Matches any string at that level. For example, “/temperatures/+/highest” would match the topics “temperatures/Paris/highest” and “temperatures/Bangkok/highest” but would not match “temperatures/Paris/highest/today”. The plus sign cannot be combined with other characters within the same level.

  • # (number sign) — Can only be the last level and matches any string at that level and any subtopics. For example “temperatures/Paris/#” would match all of the following topics: “temperatures/Paris/highest”, “temperatures/Paris/highest/today”, and “temperatures/Paris/lowest/record/thiscentury”.

Trace

This enables or disables the MQTT tracing facility. The MQTT trace messages are written to the production log for the business service or operation.

Trace Level

This is the trace level for the MQTT library. Set this to log the required detail of trace information. Trace Level can have the following values, which are defined in the %Net.MQTT include file:

  • 0 — MQTTCLIENTTRACEMAXIMUM, maximum level tracing.

  • 1 — MQTTCLIENTTRACEMEDIUM, medium level tracing.

  • 2 — MQTTCLIENTTRACEMINIMUM, minimum level tracing.

  • 3 — MQTTCLIENTTRACEPROTOCOL, trace protocol level.

  • 4 — MQTTCLIENTTRACEERROR, trace only errors.

  • 5 — MQTTCLIENTTRACESEVERE, trace only severe errors.

  • 6 — MQTTCLIENTTRACEFATAL, trace only fatal errors.

Url

This is the URL of the broker to which you wish to communicate. The scheme is either “tcp” or “ssl” followed by the domain name and port delimited by a “:”, for example, “tcp://BIGBADAPPLE.local:1883”. Typically TLS-enabled end points are configured with a port of 8883, but this is not mandatory. The Url must be ASCII-encoded.