Release date: 2020-01-18
EMQ X 4.0.0 is a major release.
In this version we significantly improved the throughput of the broker by refactoring the session and channel, improved the extensibility and monitorability by adding more hooks and counters, redesigned rule-engine SQL to filtering messages/events mainly by topics. And also lots of improvements in REST APIs, authentication plugins, and the MQTT client.
Improved the throughput of the broker:
The session process is removed. Now all the logics about session and connection are put into a single process. This significantly improves the throughput of the broker. In one of our benchmarks, we've achieved throughput max to 1 million TPS of QoS0 messages on a single node with 16 CPU cores. And another test shows emqx is able to handle 2 million concurrent connections on a single node without any problem using only about 17G memory. See the benchmark reports of emqx v4.0.0 for more information.
Optimized handling of MQTT packets:
The handling of MQTT packets is changed a lot to make a cleaner code base. See the module emqx_channel for more infomation.
Improved the metrics:
We've renamed some counters and also added more counters:
Improved the hooks:
We've modified parameters of some hooks and also added more hook-points:
Fixed the issue that failure of SSL handshake would crash the process:
To defend the process crash and give a readable error log message if SSL handshake failed.
Fixed the issue that
max_subscriptions not working:
Fixed the issue that the
zone.external.max_subscriptions in emqx.conf not working. See emqx/emqx#2908 for more information.
Fixed message out-of-order issues when forwarding across clusters:
The inter-node messages are sent via multiple RPC channels, and the strategy of choosing the channels is
random by default. This causes the messages of the same topic out-of-order after being sent to the other node. We changed the default strategy to hashed by topic in this fix.
Fixed the issue that REST API and CLI cannot get multiple routes for a topic:
See emqx/emqx-management#150 for more information.
Supported IPv6 in REST APIs:
IPv6 is now supported in all REST APIs.
The default listening port for the HTTP API server is changed from 8080 to 8081:
The old default port of management APIs 8080 is easily conflicted with other services running on the same node. We changed it defaults to 8081.
Redesgin the APIs for sessions and connections:
The session in emqx is now a concept part of the clients.
connections APIs are changed to
clients APIs, and the new APIs support all the old features was in session APIs.
Support returning the real topic of shared subscription in the subscriptions API:
Now the shared subscriptions are shown in the form of '$shared/
Support configuring the default AppID and AppSecret:
Now default AppID and AppSecret can be configured in etc/emqx_management.conf.
The HTTP API for publishing message now supports base64 encoded payload:
Some users may want to publish binary message over HTTP APIs. From this feature they can do that by sending a base64 encoded payload.
Fix the issue that encoded URI isn't handled correctly:
The API for deleting banned clients was not handling the percent encoded URL before this fix.
Support defining HTTP request headers in config files.
Support configuring the default clientids and usernames in config files:
This feature was removed from emqx v3.0, and is added again now.
Redesigned the SQL for rule engine:
SQL for rule-engine is changed a little bit in its
FROM clause. The old syntax looks like:
SELECT * FROM "message.publish"
But now it is changed to:
SELECT * FROM "t/#"
So it is now filtering messages/events mainly by topics.
This change stops rule engine from processing the
SELECT clause if the topic is not matched, so improved the performance.