MQTT Sub


The MQTT Sub node establishes an MQTT client that subscribes to a third-party MQTT server.

Node Type

Trigger.

Input and Output Ability

This node does not have an entry point and has 1 exit point. The output can be any format and is the message this client retrieves from the subscribed server.


The topic information where the output is stored is saved in the metadata and can be referred to by the expression ${metadata.topic}.

Node Properties

../../_images/mqtt_sub.png


Node Name

Required.

The name for this node.


Host

Required.

The URL of the MQTT server.


Port

Required.

The port of the MQTT server.


Authentication Method

Required.

The method by which the request made by this node is authenticated. Values include the below.

  • Anonymous: Making an anonymous request by using a different IP address every time.

  • Username/Password: Passing the username/password in the request for authentication. If selected, the following fields are required.

    • User Name: The user name the client uses to log in to the server.

    • Password: The password the client uses to log in to the server.

  • Uni-directional: Using encrypted communication where the MQTT client authenticates the credential obtained from the server. If selected, the following is required.

    • Certificate: The certificate from the server that the MQTT authenticates.

  • Bi-directional: Using encrypted communication where the MQTT client and server both authenticate each other’s credentials. If selected, the following is required.

    • Certificate: The certificate from the server that the MQTT authenticates.

    • Client Certificate: The client certificate to be authenticated by the MQTT server.

    • Client Certificate Key: The client certificate key to be authenticated.

    • Client Password: The client password to be authenticated.


Topic

Required.

The topic of the MQTT server to which the MQTT client subscribes. You can specify up to 5 topics.


Clear Previous Sessions

Optional.

Clear the previous sessions between the client and server whenever the client reconnects to the server.


Description

Optional.

The description for this node.


Test Connection

You can click the Test Connection button to test the MQTT connectivity.

Limitations

  • Number of connections: 1

  • Maximum number of topics: 5

  • As the MQTT server is not managed by EnOS, connection problems could occur due to server downtime or other instances that are not within our control.

Samples

Input Sample

Example of a JSON object as input:

{
   "externalId":"externalId",
   "timestamp":24214324324,
   "measurepoints":{
     "speed":32,
     "heat":40
   }
 }

Output Sample

Example of a JSON object retrieved from the MQTT server. Its topic information is stored in the metadata.

{
    "externalId":"externalId",
    "timestamp":24214324324,
    "measurepoints":{
        "speed":32,
        "heat":40
    }
}