MQTT Adapter for SAP Hana Cloud Platform, integration services – SAP HCI
Tutorial – Introduction
MQTT is a machine to machine protocol which supports a lightweight version of publish/subscribe messaging transport. It is therefore mostly used in Internet of Things (IoT) scenario. Typically speaking, devices will need to send messages to a MQTT broker.
For customers and partners using SAP, Rojo Consultancy B.V has developed a MQTT adapter for the SAP Hana Cloud Platform, Integration Services (SAP HCI). To read more about this adapter, refer to:
http://www.rojoconsultancy.com/en/products/mqtt-adapter
This tutorial will give you a step by step demonstration of how you can use the SAP HCI MQTT adapter.
Note that the MQTT adapter is not available by default in your SAP HCI tenant. You will need to purchase it from Rojo Consultancy.
For those who like to gain a deeper understanding of SAP HCI, you can refer to our book:
https://www.sap-press.com/sap-hana-cloud-integration_3979/
Scenario
You have a number of devices deployed in the field. For sake of simplicity, assume that these are vending machines for selling different types of cookies. As the company owning the vending machines, you would like to have direct access (online) of the events happing on the vending machines.
For simplicity sake, assumes that these devices are pushing their events at mosquitto.org publicly available MQTT server. Mosquitto provides a free MQTT broker that can be used to ease your exploration of what is possible with our MQTT adapter.
Figure 1. Scenario
Because the focus of this article is how to use the MQTT adapter, to show case the feature of both sender and receiver adapter, we will pick the message from one MQTT topic (using the sender MQTT adapter) and push the message to another MQTT topic (using the receiver MQTT adapter). This scenario is depicted in the above Figure. We are assuming that your devices are already sending data to the MQTT broker.
Solution: Create a simple integration flow with the MQTT Adapter
Requirements
- SAP HANA Cloud Integration tenant
- MQTT Client e.g. MQTT fx (can be download at http://mqttfx.jfx4ee.org)
Step 1. Create an integration package in SAP HCI
- Launch SAP HCI Web application by accessing the URL provided by SAP.
- If you are a new user, choose Signup.
- If you have user credentials, choose Login.
Figure 2. SAP HCI – Home
- Select
and choose the Design tab.
- Choose Create and insert the required data to create a new Integration Package.
Figure 3. SAP HCI – New Integration Package
Step 2. Create and add a new integration flow in SAP HCI
- Choose Add, and select Process Integration to add a new integration flow as an artifact.
- Select Create and enter the required data.
Figure 4. SAP HCI – Add Process Integration Artifact
Choose Ok to add the process integration artifact.
- Choose Save to keep the integration package.
Step 3. Assign MQTT Adapter to integration flow in SAP HCI
- Click on the integration flow artifact name and choose Edit.
Figure 5. SAP HCI – Configuration Integration Flow
- Select Sender and choose
to drag the pointer to Start to define the sender channel.
- Choose MQTT adapter.
Figure 6. SAP HCI – Choose Adapter Type
- Select End and choose
to drag the pointer to Receiver to define the receiver channel.
- Choose MQTT adapter.
Figure 7. SAP HCI – Configuration Integration Flow with Sender and Receiver MQTT Adapter
Step 4. Configure Sender MQTT Adapter in SAP HCI
- Choose Edit.
- Select the Sender MQTT adapter, select General tab and enter the required data into fields Name and Description.
Figure 8. SAP HCI – General Tab in Sender MQTT Adapter
- Select Adapter Specific tab and enter the data into Connection Details. In this scenario mosquito.org is used, with port 1883. Topic name can be anything and “/” indicates a topic level separator.
Figure 9. SAP HCI – Adapter Specific Tab in Sender MQTT Adapter
- Select Advanced tab and insert the data into Advanced Option.
Figure 10. SAP HCI – Advanced Tab in Sender MQTT Adapter
- Choose Save to keep this configuration of the Sender MQTT adapter.
Step 5. Configure Receiver MQTT Adapter in SAP HCI
- Select Provider MQTT adapter, select General tab and insert the required data into fields Name and Description.
Figure 11. SAP HCI – General Tab in Receiver MQTT Adapter
- Select Adapter Specific tab and insert the data in section Connection Details.
Figure 12. SAP HCI – Adapter Specific Tab in Receiver MQTT Adapter
- Select Advanced tab and insert the data into Advanced Option, similar to the Sender MQTT Adapter configuration.
Figure 13. SAP HCI – Advanced Tab in Receiver MQTT Adapter
The Last Will and Testament tab is not configured in this tutorial.
- Choose Save to keep this configuration of the Receiver MQTT adapter and choose Deploy.
Figure 14. SAP HCI – Integration Flow Triggered for Deployment
And voila! You have finished your configuration and can now proceed with testing.
For the purpose of testing, you can use any MQTT client of your choice (like MQTT fx) to place a file in the topic that the sender adapter is reading. e.g: “amsterdam/buildingA/floor1/temperature”.
Reference
You can also find more information on this adapter at:
Youtube: https://www.youtube.com/watch?v=848tjsv3eiU
Webinar: http://go.sap.com/assetdetail/2016/07/16ab8200-807c-0010-82c7-eda71af511fa.html
Hello John, none of images are visible.
Hi,
I can see the images.
Best Regards,
Michal Krawczyk
Hi Jitendra
Please refresh your page, might be caching related.
Kind regards
John Bilay
It works now. thanks
Hi,
Thanks for sharing the tutorial, very informative and well written.
Thanks,
Swati
Thanks, John. Good tutorial.
Hi John,
Thanks for the document, keep sharing more 🙂
Regards,
Aman