This commit adds a function to the rule engine that alows users to transform text or JSON objects using [jq filter programs][1]. [jq][1] is a command line tool that can be used to transform and filter JSON text using jq's built-in language. The rule engine function that is added with this commit uses the [Erlang jq NIF library][2] that wraps the jq C library in an Erlang NIF function. [1]: https://stedolan.github.io/jq/ [2]: https://github.com/emqx/jq |
||
|---|---|---|
| .. | ||
| etc | ||
| i18n | ||
| include | ||
| src | ||
| test | ||
| .gitignore | ||
| README.md | ||
| rebar.config | ||
emqx-rule-engine
IoT Rule Engine
Concept
iot rule "Rule Name"
when
match TopicFilters and Conditions
select
para1 = val1
para2 = val2
then
take action(#{para2 => val1, #para2 => val2})
Architecture
|-----------------|
Pub ---->| Message Routing |----> Sub
|-----------------|
| /|\
\|/ |
|-----------------|
| Rule Engine |
|-----------------|
| |
Backends Services Bridges
SQL for Rule query statement
select id, time, temperature as t from "topic/a" where t > 50;