如何在Bluemix中从IoT平台调用OpenWhisk操作 [英] How to invoke an OpenWhisk action from IoT Platform in Bluemix

查看:91
本文介绍了如何在Bluemix中从IoT平台调用OpenWhisk操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想知道如何从Bluemix中的IoT平台调用OpenWhisk操作.我们想要完成的是:

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

  1. 将事件数据从设备发送到IoT平台
  2. 订阅活动
  3. 调用OpenWhisk操作.

我们假设事件数据为JSON格式.我们知道我们可以开发一个应用程序来订阅IoT平台上的事件,例如: https://console.bluemix.net/docs/services/IoT/applications/libraries/java.html#java .但是,我们认为必须有更简单的方法.

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.

如果我们查看IoT Platform,我们可以创建一个操作,例如IFTTT,Webhook操作,将事件转发到云等.通常来说,建议您从IoT Platform中调用哪种方式来调用OpenWhisk操作?

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.

推荐答案

IBM消息中心可以在 Watson IoT平台和OpenWhisk之间自动桥接消息.

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

Watson IoT服务提供了一种集成,可将所有传入的主题消息转发到IBM Message Hub. IBM Message Hub 是IBM Bluemix上的Apache Kafka-as-a-Service产品.

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.

以下是使用 IBM Message Hub . https://console.bluemix.net/docs/services/IoT/message_hub.html#messagehub_main

OpenWhisk具有触发供稿服务,用于IBM Message Hub .您可以让触发器订阅来自消息中心主题的消息.然后可以将动作绑定到触发器,以针对每个事件自动触发.

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.

下面是一个示例,向您介绍如何将OpenWhisk操作连接到Message Hub主题: https://github.com/IBM/openwhisk-message-hub-trigger

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

这篇关于如何在Bluemix中从IoT平台调用OpenWhisk操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆