EdgexGo2.0学习-16 Kuiper数据流定义

1、EdgeX Kuiper数据流来源
image
2、创建一个数据流

curl -X POST \
  http://127.0.0.1:59720/streams \
  -H 'Content-Type: application/json' \
  -d '{
  "sql": "create stream demo() WITH (FORMAT=\"JSON\", TYPE=\"edgex\")"
}'

3、定义一个Rules

curl -X POST \
  http://127.0.0.1:59720/rules \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "rule1",
  "sql": "SELECT * FROM demo",
  "actions": [
    {
      "mqtt": {
        "server": "tcp://192.168.10.39:1883",
        "topic": "result",
        "clientId": "demo_001"
      }
    },
    {
      "log":{}
    }
  ]
}'

4、显示数据如下

posted @ 2021-11-03 13:46  zhaogaojian  阅读(52)  评论(0编辑  收藏  举报