Commit Graph

510 Commits

Author SHA1 Message Date
Thales Macedo Garitezi
47bd19dee4 chore: lower error log messages down to debug 2023-09-07 13:40:03 -03:00
Thales Macedo Garitezi
bb55b04d46 refactor: inline fn clauses, improve error logging 2023-09-06 13:54:40 -03:00
Thales Macedo Garitezi
c9100c7591
refactor: improve logging information and descriptions
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
2023-09-06 13:33:59 -03:00
Thales Macedo Garitezi
78c5a779d7 feat(republish): allow templating mqtt properties
Fixes https://emqx.atlassian.net/browse/EMQX-10912
2023-09-06 09:54:02 -03:00
Ivan Dyachkov
999988cab4
Merge pull request #11401 from kjellwinblad/kjell/fix/mongo_date_format/EMQX-10727
fix: rule SQL mongo_date function should return a string in test mode
2023-08-21 16:20:59 +02:00
Andrew Mayorov
75ed6aa8e7
Merge pull request #11396 from keynslug/ft/EMQX-10712/ruleeng-topic-index-vol-2
perf(ruleeng): employ `emqx_topic_index` to speed up topic matching
2023-08-17 20:43:09 +04:00
firest
040d28c35e fix(cli): fix two typos in the time unit 2023-08-16 18:46:17 +08:00
firest
8cd21da94b chore: update apps version 2023-08-16 10:55:54 +08:00
firest
b08102269a refactor(calendar): refactor datetime-related code and remove redundant 2023-08-16 10:55:46 +08:00
Andrew Mayorov
fe9477f92e
chore: bump applications versions
* emqx_rule_engine 5.0.23
2023-08-14 15:36:58 +04:00
Andrew Mayorov
47dfba4341
perf(ruleeng): employ emqx_topic_index to speed up topic matching 2023-08-14 15:36:58 +04:00
lafirest
bef8eddad3
Merge pull request #11405 from lafirest/fix/kal_kialo
fix(calendar): make date parse error reason more sense
2023-08-09 14:42:08 +08:00
Kjell Winblad
b38461e50a fix: mongo_date/2 shall give user friendly value in the test environment 2023-08-08 14:47:07 +02:00
firest
9f38f5f26a fix(calendar): make date parse error reason more sense 2023-08-08 14:28:38 +08:00
Kjell Winblad
3ed031db70 fix: rule SQL mongo_date function should return a string in test mode
The rule SQL mongo_date function should return a string with the format
ISODate(*), where * is an ISO date string when running the rule in test
mode.

Fixes:
https://emqx.atlassian.net/browse/EMQX-10727
2023-08-07 16:10:30 +02:00
Ivan Dyachkov
63adeabf72 chore: bump app versions 2023-07-27 15:29:03 +02:00
JianBo He
951a96457b
Revert "feat(index): add topic index facility " 2023-07-27 13:42:43 +08:00
JianBo He
5e4855334e
Revert "Fix(topicidx): allow to return matches unique by record id" 2023-07-27 13:39:37 +08:00
zhongwencool
2c193f26e6
Merge pull request #11332 from HJianBo/fix-topic-index-unique-bugs 2023-07-25 19:07:07 +08:00
JianBo He
d05a5cfe0f fix(rule): fix the matches/2 for some edge cases 2023-07-25 14:35:18 +08:00
JianBo He
e630331de1 fix(rule): fix a quering problem when 'a/b' and 'a/b/#' exist at the same time.
When using `ets:next` to query the next level of topic words, we should prioritize the next level
of '#', '+'.
2023-07-24 23:04:53 +08:00
JianBo He
dcf4819c04 test(rule): add tests to ensure the rules ordering 2023-07-24 19:30:34 +08:00
Andrew Mayorov
0496038361 fix(ruleeng): ensure topic index matched rules evalauted once 2023-07-24 17:44:12 +08:00
Andrew Mayorov
6432c9c8fc fix(topicidx): allow to return matches unique by record id 2023-07-24 17:43:11 +08:00
firest
af6405fa25 fix(nested_put): fix a data loss bug introduced by #11172 2023-07-24 16:39:37 +08:00
JimMoen
c393c2e091
test: ets table cleanup after cases 2023-07-24 09:33:28 +08:00
JimMoen
4e4b1ac115
refactor: module move to app emqx_rule_engine
- Rename to emqx_rule_index.erl
- Remove test funcs from src -> test dir
2023-07-24 09:33:28 +08:00
Andrew Mayorov
b821bdee00
perf(ruleeng): employ emqx_topic_index to speed up topic matching 2023-07-24 09:27:31 +08:00
Thales Macedo Garitezi
2531c3e7d1
Merge pull request #11306 from thalesmg/rule-actions-reply-dropped-r51-20230719
fix(rule_metrics): notify rule metrics of late replies and expired requests
2023-07-21 16:51:14 -03:00
Serge Tupchii
a1a7c4fab6 fix(emqx_rule_engine): fix typo in behaviour module attribute
The type resulted in missing `rule_engine` config after importing data from a backup file.

Fixes: EMQX-10590
2023-07-21 10:33:56 +03:00
Thales Macedo Garitezi
eb41b77de4 fix(rule_metrics): notify rule metrics of late replies and expired requests
Fixes https://emqx.atlassian.net/browse/EMQX-10600
2023-07-19 11:39:28 -03:00
Thales Macedo Garitezi
ab5fd1e5c3
Merge pull request #11260 from thalesmg/fix-rule-maps-nested-put-r51
fix(rule_maps): avoid losing data when using `emqx_rule_maps:nested_put`
2023-07-14 15:02:24 -03:00
Thales Macedo Garitezi
f9452241bd test(rules): add a few more tests to assert our rule evaluation behavior 2023-07-14 10:23:20 -03:00
Thales Macedo Garitezi
4034bcbb26 fix(rule_runtime): avoid rewriting select clause sources (by @keynslug)
Thanks to @keynslug for the insight and the patch.

With this, we avoid rewriting the parsed select clause sources, and
attempt to reuse the result context when reading values during
evaluation.
2023-07-13 14:46:08 -03:00
Thales Macedo Garitezi
bffef386c1 fix(rule_maps): avoid losing data when using emqx_rule_maps:nested_put
Fixes https://emqx.atlassian.net/browse/EMQX-10541
2023-07-12 14:28:18 -03:00
Thales Macedo Garitezi
541d03a0ba refactor(schema_registry): refactor schema registry app and modules
Fixes https://emqx.atlassian.net/browse/EMQX-10361

- Moves `lib-ee/emqx_ee_schema_registry` to `apps/emqx_schema_registry`.
- Removes the `_ee_` segment from module names.
  - Exceptions are the table names which are kept to avoid backwards incompatibilities.
2023-07-12 09:24:15 -03:00
Ilya Averyanov
19f9fc5089 feat(authz): bump app versions 2023-07-07 19:41:34 +03:00
Ilya Averyanov
7de26a1776 feat(authz): use extensible map format for actions in authz rules
* support authorization on retain, qos fields
* refactored authz tests heavily
2023-07-07 19:40:34 +03:00
lafirest
bf5167a8bf
Merge pull request #11172 from lafirest/fix/dup_payload
fix(ruleengine): fix duplicate `payload` problems
2023-07-05 14:20:26 +08:00
Kjell Winblad
33cb29efdb
Merge pull request #11169 from kjellwinblad/kjell/improved_sparkplugb/EMQX-10351
feat: add Sparkplug encode and decode functions to the rule engine
2023-07-04 07:24:06 +02:00
firest
902603780b test(ruleengine): add test for the fix of duplicate payload 2023-07-03 18:22:35 +08:00
firest
bd4f207365 fix(ruleengine): fix duplicate payload problems 2023-07-03 14:21:56 +08:00
Stefan Strigler
07cf250093
Merge pull request #11126 from sstrigler/EMQX-8842-fix-rule-metrics
fix(emqx_rule_engine): set inc_action_metrics as async_reply_fun
2023-06-30 20:07:23 +02:00
Kjell Winblad
714363bd01 fix: decouple emqx_rule_engine application from emqx_ee_schema_registry
This commit decouples the emqx_rule_engine application from the
emqx_ee_schema_registry application by making it possible to register a
callback module that defines extra rule engine SQL functions instead of
calling a module in emqx_ee_schema_registry directly from the
emqx_rule_engine application.
2023-06-30 16:56:16 +02:00
Kjell Winblad
039e27a153 feat: add Sparkplug encode and decode functions to the rule engine
Fixes:
https://emqx.atlassian.net/browse/EMQX-10429
2023-06-30 10:06:56 +02:00
firest
872698d19e feat(ruleengine): port random && uuid_v4 functions from v4 2023-06-30 14:38:27 +08:00
Stefan Strigler
14da61194e fix: handle resource errors 2023-06-29 16:09:45 +02:00
Stefan Strigler
321fd53132 fix: use ReplyTo in QUERY for async 2023-06-29 16:09:45 +02:00
Stefan Strigler
d71d70c889 fix: allow to pass in Opts rather than just a ReplyTo 2023-06-29 16:09:45 +02:00
Stefan Strigler
422c79583a test(emqx_rule_engine): fix simple sync 2023-06-29 16:09:45 +02:00