规则引擎(收发数据处理逻辑)

2022-04-14 15:17:23
微图
1732
最后编辑:微图 于 2023-07-30 19:03:45
分享链接

文档链接:

数据流

规则测试:

响应动作

查看链接可以有哪些参数


SELECT
  *
FROM
 "$events/client_connected"


输出响应


{
  "username": "u_emqx",
  "timestamp": 1649920466373,
  "sockname": "0.0.0.0:1883",
  "proto_ver": 5,
  "proto_name": "MQTT",
  "peername": "127.0.0.1:52918",
  "node": "[email protected]",
  "mountpoint": "undefined",
  "metadata": {
    "rule_id": "test_rule409ec778"
  },
  "keepalive": 60,
  "is_bridge": false,
  "expiry_interval": 3600,
  "event": "client.connected",
  "connected_at": 1649920466373,
  "clientid": "c_emqx",
  "clean_start": true
}

设备上下线响应

连接mysql数据库,新增/更新数据库

收到消息写库

备注:

发现我这开源版没连数据库的资源选项,只有webservice和mqtt之类的

SELECT
  payload,
  substr(payload, 4, 5) as dnum,
  substr(payload, 9, 9) as code
FROM
  "cja"
WHERE
  (substr(payload, 9, 9) = '1' or substr(payload, 9, 9) = '2' or substr(payload, 9, 9) = '8')
  and substr(payload, 0, 2) = 'ff'

发表评论
评论通过审核后显示。
  • 在线客服
  • 关注微信
    • 客服帆帆
    • 客服娜娜
    • 客服美美
    • 客服龙龙
  • 扫一扫关注微信