How to Receive and Send Messages with the MQTT Connector

Document created by Adam Arrowsmith Employee on Nov 29, 2016Last modified by Adam Arrowsmith Employee on Dec 14, 2016
Version 6Show Document
  • View in full screen mode

This article provides a step-by-step guide to configuring MQTT Connector to both receive and send MQTT messages.

 

 

 

Overview

The industry is moving towards Internet of Things (IoT). This calls for simplification of features available for integrating the sensor data.

 

MQTT is a protocol used for IoT communications. The MQTT Connector within AtomSphere allows you to exchange messages via this protocol with an MQTT broker.

 

Use Case

The scenario for this tutorial is as follows:

  • Sensor data (the request) is received from devices all over the world on a master data topic.
  • This data is routed based on its content, which contains the name of the originating country and sent to country specific MQTT topics.
  • The data is a simple delimited format: <Country Code>|<Severity>|<Title of request>|<Country specific email>
    • Note this format is arbitrary. The actual format will vary by sensor device.

 

IoT communication can include various protocols. AtomSphere permits integration with MQTT protocol. If data is received using any other protocol, an external gateway might have to be used for conversion to MQTT protocol. For example, AtomSphere receives data from an external broker which has sensor data and passes on the data to Data Center and Core Analytics team.

 

 

Approach

The general approach for using the MQTT Connector is as follows:

  1. Design considerations including the type of topics/bridges to be created.
  2. Create topics in the broker.
  1. Create complete process for the scenario.
  2. Deploy the process.
  3. Test the process for Send/Listen Modes of Configuration of MQTT connector.

 

Implementation

The example processes below are used to illustrate the relevant concepts and are not intended to be fully configured.

 

The example uses the Websockets UI for pushing messages. CloudMQTT supports MQTT over websockets. MQTT over websockets allows every browser to be an MQTT client. You can push messages to your browser when an event occurs or publish messages to your device.

 

1. Design Considerations

There should be a single process that listens to the message flowing into the Master data topic and then routes data to country-specific topics.

 

2. Create Topics

Within CloudMQTT, create one topic for all the incoming requests (boomi.Master_Data_Center) and four topics for country-specific data centers in the message broker.

 

 

3. Create Process

 

 

  1. Within AtomSphere create a new process and configure the Start shape with Connector=MQTT and Action=Listen to receive messages from the broker.
    1. Create a new connection with the details available on https://api.cloudmqtt.com/sso/cloudmqtt/console.
    2. Create a new operation with details of the topic created for receiving all requests.
  2. The incoming message is then routed to country specific data center topics for analytics by using a Flat File profile to parse the incoming data.
  3. On each route branch, add a Connector shape configured with Connector=MQTT and Action=Send.
    1. Choose the same connection created for the listener above.
    2. Create a new operation for each country-specific topic:
  4. Save the process.

 

4. Deploy Process

The process must be deployed because the listener cannot receive data in Test Mode. On the Deploy tab, attach and deploy the process to the desired Environment/Atom.

 

5. Execute and View Results

  1. From the WebSocket UI, send a message on the master data topic:
  2. Check the Process Reporting tab.
  3. In the CloudMQTT Console, you will see the message has reached the country-specific topic
2 people found this helpful

Attachments

    Outcomes