Skip to Content

The first part of this blog series contains a small introduction to the MQTT(*) concept. This part will highlight a demo scenario where temperature data is received – asynchronously – from a device. The device data is offered in JSON format and contains the temperature, the sensor ID and a timestamp. Obviously, this data can be sent to a SAP system or written to a flat file e.g., but that is not in scope of this blog.

This is how the input data actually looks like in JSON format

{

  “Company”: “TheValueChain”,

  “TemperatureData”: {

      “SensorID”: “000011”,

      “Temperature”: “28,0°C”,

      “Timestamp”: “20160825”

  }

}

Before diving into the configuration, let’s have a look at the device simulation part of the scenario. Basically, this is what you have to keep in mind

/wp-content/uploads/2016/08/overview2_1023802.png

First of all, configure a sender MQTT adapter to subscribe to a specific topic.

/wp-content/uploads/2016/08/overview3_1023803.png

Note that, at the bottom of the screenshot, I indicated that I wanted to have both the message metadata and the payload available in the monitoring tools. The input data is in JSON format. Therefore, do not forget to set the transform indicator on the second tab page. That’s it for the sender adapter!

Once you’ve activated everything, you can see in the monitoring that the adapter will connect to the MQTT broker

/wp-content/uploads/2016/08/overview4_1023804.png

if everything goes well, you will see both the JSON and XML data in the Message Log

/wp-content/uploads/2016/08/overview5_1023805.png

Also some useful Message Attributes can be noticed

/wp-content/uploads/2016/08/overview6_1023806.png

In this demo, the source message type and namespace were not modified or used. Just to keep it simple and straightforward.

In part III, I will explain how to set up a synchronous scenario were data is retrieved from a SAP system and offered back to the MQTT broker.

(*) More information can be found here or here.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply