Configuring emqx_rule_engine plugin events events cannot take effect
What happened?
My meqx version is 4.3.5, started via docker. Configured in environment variables EMQX_RULE-ENGINE__EVENTS__CLIENT_CONNECTED: on, qos1 EMQX_RULE-ENGINE__EVENTS__CLIENT_DISCONNECTED: on, qos1 Or configure it in the configuration file /opt/emqx/etc/plugins/emqx_rule_engine.conf
Subscribe via Subscription Super Admin $events/client_connected Didn't receive the notification of the client going offline
What did you expect to happen?
Receive notification of client going offline
How can we reproduce it (as minimally and precisely as possible)?
No response
Anything else we need to know?
No response
EMQX version
4.4
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Log files
Hi.
EMQX_RULE-ENGINE__EVENTS__CLIENT_CONNECTED is not a valid environment variable name (mind the -).
Please try EMQX_RULE_ENGINE__EVENTS__CLIENT_CONNECTED.
Using the EMQX_RULE_ENGINE__EVENTS__CLIENT_CONNECTED environment variable injection still fails to take effect, and subscribing to $events/client_connected still fails to receive the client online message
This is my docker configuration diagram
Hi @mijjjj $event topics are 'virtual' topics, ~~they do not exist in the routing table, so no client can subscribe to it.~~
the events are not published as MQTT messages, but only processed in rule-engine.
Hi @mijjjj
I was not able to reproduce the issue you reported.
Tried to run with this command:
docker run --network host --rm -it -e EMQX_RULE_ENGINE__EVENTS__CLIENT_CONNECTED='on, qos1' emqx/emqx:4.4.8 bash
and created a debug rule like this:
SELECT * FROM "$events/client_connected" with a inspect action (for debug)
Then connect a client, I was able to see printouts in the console.