Altova MobileTogether Designer

(Un)Subscribe to MQTT Topic

Home Prev Top Next

The (Un)Subscribe to MQTT Topic action (screenshot below) contains three related actions, from which you can select one via its radio button: (i) Subscribe to a topic; (ii) Unsubscribe from a topic; and (iii) Disconnect from a broker. These actions are described below.

 

Subscribe and Unsubscribe to a topic

The Subscribe and Unsubscribe actions (see screenshot below) enable MT client devices to, respectively, subscribe and unsubscribe to a topic that is hosted at a particular broker. Choose the appropriate radio button (Subscribe or Unsubscribe) to set up the relevant action. The settings for both actions are the same. The Subscribe action, however, takes one additional setting: the Quality of Service setting.

MTActionMQTTSubscribeToTopic

The settings of the Subscribe and Unsubscribe actions are listed below. They take XPath expressions that evaluate to strings.

 

Client ID: The unique name of the MQTT subscriber client.

Broker Address and Port: The IP address of the broker providing the topic for subscription and the port at this IP address via which the MT client connects. MobileTogether automatically connects to the broker when the action is triggered.

Topic: The topic to which the client wants to subscribe or unsubscribe.

Secure connection: If you want to use a secure connection, select this option and enter your username and password.

Client Certificate: Enter an XPath expression that evaluates to the text of the certificate.

Quality of Service: This setting is available for the Subscribe action and not for the Unsubscribe action. Select one of the three options allowed by the MQTT specification: At most once, At least once, or Exactly once.

 

Disconnect from broker

The Disconnect action (screenshot below) disconnects the MT client device from the specified broker. Select the Disconnect radio button to define the action's settings.

MTActionMQTTDisconnect

The settings of the Disconnect action are listed below. Each takes an XPath expression that evaluates to a string.

 

Client ID: The unique name of the MQTT subscriber client.

Broker Address and Port: The IP address of the broker from which the client is to be disconnected and the port at this IP address via which the client connects.

Secure connection: If you want to use a secure connection, select this option and enter your username and password.

Client Certificate: Enter an XPath expression that evaluates to the text of the certificate.

 

MobileTogether extension functions

MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.

 

mt-string-to-hexBinary()

mt-hexBinary-to-string()

 

© 2018-2024 Altova GmbH