How to invoke an OpenWhisk action from IoT Platform in Bluemix

我的未来我决定 提交于 2019-12-11 04:43:12

问题


We would like to know how to invoke an OpenWhisk action from IoT Platform in Bluemix. What we want to accomplish is:

  1. Send an event data from a device to IoT Platform
  2. Subscribe the event
  3. Call an OpenWhisk action.

We are assuming the event data is JSON format. We know we can develop an application that subscribes to an event on the IoT Platform like: https://console.bluemix.net/docs/services/IoT/applications/libraries/java.html#java. However, we believe that there must be a more simpler way.

If we look at IoT Platform, we can create an action such as IFTTT, Webhook action, Forward event to cloud, etc. Generally speaking, which way do you recommend to invoke an OpenWhisk action from IoT Platform?

Any comments or suggestions must be appreciated. Thank you.


回答1:


IBM Message Hub can automatically bridge messages between the Watson IoT platform and OpenWhisk.

Watson IoT service provides an integration to forward all incoming topics messages to IBM Message Hub. IBM Message Hub is an Apache Kafka-as-a-Service offering on IBM Bluemix.

Here are the instructions for connecting and configuring a historian service for the Watson IoT platform using IBM Message Hub. https://console.bluemix.net/docs/services/IoT/message_hub.html#messagehub_main

OpenWhisk has a trigger feed service for IBM Message Hub. You can have triggers subscribe to messages from a Message Hub topic. Actions can then be bound to triggers to fire automatically for each event.

Here's an example walking you through connecting an OpenWhisk action to the Message Hub topic: https://github.com/IBM/openwhisk-message-hub-trigger



来源:https://stackoverflow.com/questions/45374128/how-to-invoke-an-openwhisk-action-from-iot-platform-in-bluemix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!