Commit Graph

69 Commits

Author SHA1 Message Date
turtled faeda253e1 Fix conflicts 2018-11-10 11:44:55 +08:00
terry-xiaoyu 997958aed1 Change the start_link API for emqx_client
Prior to this change, emqx_client:start_link does 2 works in one call:
- init an erlang process for emqx_client
- send MQTT CONNECT to remote broker

But this solution have some drawbacks:

- the return value of `start_link` compiles the return values of the 2
 works: {ok, Pid, MqttResult}. It is inconsistent with the return value
 of `gen_statem:start_link`, may causes confusions.

- the return mode of the 2 works are different:
  `start_link` should always return {ok, Pid} or {error, Reason}, but
 connecting to mqtt may throw out exceptions as it handles the
 socket. But the caller couldn't have thought of the exception, he would
 pattern match on the result of `emqx_client:start_link`, but it crashed!

- If the init work succeed but the connection failed, the caller couldn't
get a Pid from the return value, but indeed it was created inside the
emqx_client. This hides the fact that the Pid was created, and when the
Pid dies, the caller would receive an message from a Pid it doesn' know about.

This change divived these 2 work into 2 APIs:
- `start_link/1` is to build and verify the options, and returns {ok,Pid}
 (on success) or {error, Reason} (on failure).
- `connect/1` is to send MQTT CONNECT, and returns {ok, MQTTResult::properties()} or
 {error, MQTTReason}. MQTT reason codes will contains in the `MQTTReason`.
2018-11-09 17:43:04 +08:00
terry-xiaoyu 2dc8ec8b11 Bridge via TLS 2018-11-09 17:43:04 +08:00
terry-xiaoyu f448c62e47 Fix config descriptions of ACL cache 2018-11-08 20:41:57 +08:00
terry-xiaoyu 92cc171aaf Support tracing log files for specific topics or clients 2018-11-02 18:38:07 +08:00
terry-xiaoyu 94dbdffd59 New logger formatter with meta-data 2018-11-02 18:38:07 +08:00
terry-xiaoyu 2c63aef3f6 Update schema 2018-11-02 18:32:42 +08:00
terry-xiaoyu 1222dd0eab Update log config template 2018-11-02 18:32:42 +08:00
terry-xiaoyu 46c7e86331 Fix some grammar 2018-11-02 18:32:42 +08:00
terry-xiaoyu 8f5b7a0d05 Optimize config for log section 2018-11-02 18:32:42 +08:00
spring2maz ae743ad1f0 Rewrite emqx_mqueue.erl
Fixed bugs:

- Priority queue lack of a `len + 1` logic in `in/2`

Changed behaviors:

- Topics not found in priority table (from config) will be treated with default priority,
  instead of hasing topic name to a priority number.
- Default priority is now configurable (it was always lower than all configured priorities)
- The dropped message due to reaching `max_len` is now returned from `in/2`,
  so the queue owner (`in/2` caller) can perform autopsy on it
2018-10-27 14:21:53 +02:00
Gilbert Wong 3f761cbe6a Support use certifate as username
Prior to this change, you can just use CN or EN field from the client
certificate as username.

This change add a new option to allow user to use Certificate directly as
username.
2018-10-23 14:37:05 +08:00
Gilbert 4c40f75f4b Request & Response (broker and client) (#1819)
Add request & response support for CONNECT & CONNACK

Prior to this change, there is no validate and specified process for
Request-Response-Information and Response-Information

Also added basic Request/Response functionality to emqx_client implementation
2018-10-18 19:21:05 +02:00
HuangDan 1bc175e0ce Add mountpoint config to zone configs 2018-09-28 18:53:52 +08:00
HuangDan d1c72b92af Add 'sticky' dispatch strategy for shared subscription 2018-09-27 10:46:14 +08:00
Feng Lee db520b9b94 Disable the rate_limit of MQTT/TCP listener by default. 2018-09-25 22:46:37 +08:00
Feng Lee 795ee300d1 Disable the publish_limit by default 2018-09-22 16:26:39 +08:00
Feng Lee 5689ad3485 Fix issue #1847.
Change the config of 'zone.$name.publish_limit'
2018-09-22 16:26:39 +08:00
turtleDeng 8f35d13e17 Improve bridges design (#1849)
Improve the design of bridges
2018-09-22 16:19:28 +08:00
turtleDeng 8653732bae Revert "Calculate the 1.5 keep alive time exactly" 2018-09-22 14:52:31 +08:00
Feng Lee 33f9e895ad
Merge branch 'emqx30' into more-gc-enforcement-policies 2018-09-22 05:52:41 +08:00
Feng Lee fbac9ce43e Improve the foce_gc_policy config. 2018-09-22 05:42:38 +08:00
周子博 073bf481c9 Calculate the 1.5 keep alive time exactly 2018-09-20 15:51:28 +08:00
Michal-Drobniak 737dcff44e Add space before plugins.etc_dir in emqx.conf 2018-09-14 19:13:43 +02:00
周子博 f5ed6ddb05 Change comments 2018-09-14 11:49:17 +08:00
周子博 5eb92e37cc Remove check for MQTT path, and normalize code 2018-09-14 11:49:17 +08:00
周子博 6f536eaac4 Add customized mqtt path for websocket 2018-09-14 11:49:17 +08:00
周子博 88b3460715 Add feature for issue#1809 2018-09-14 11:49:17 +08:00
Feng Lee 3045ec10ab Add banned feature 2018-08-31 14:04:26 +08:00
Feng Lee e6bed24bb3 Add server_keepalive config 2018-08-31 00:32:56 +08:00
Feng Lee b0fad7a86d Change the default value of 'zone.external.await_rel_timeout' to 300s 2018-08-30 21:02:01 +08:00
Feng Lee 8ed6266ace Add mqueue_type, mqueue_priorities options 2018-08-30 18:26:13 +08:00
HuangDan 18eee0f1b0 Fixed Conflicting files 2018-08-30 10:53:35 +08:00
HuangDan 53d7d0a9d4 Update the peer_cert_as_username conf desc 2018-08-30 10:35:20 +08:00
HuangDan 0fbf813ebf Add mqtt connect tests cases 2018-08-30 10:35:04 +08:00
Feng Lee 465963fec3
Merge branch 'emqx30' into emqx30-feng 2018-08-29 17:36:38 +08:00
Feng Lee 8e11845f87 Remove ignore_loop_deliver option 2018-08-28 07:36:22 +08:00
Feng Lee d167a5c99a
Merge pull request #1748 from emqtt/emqx30-feng
Improve the emqx_listeners module
2018-08-27 16:24:59 +08:00
Feng Lee e5b2e584e9 Remove 'TODO:' 2018-08-27 15:57:36 +08:00
turtled 91eb79967c Add syslog 2018-08-27 13:50:38 +08:00
terry-xiaoyu 9d29dd0e10 use config enable_acl_cache 2018-08-26 18:25:17 +08:00
terry-xiaoyu 8cd20744be improve cache datastruct using keys-queue 2018-08-26 13:33:00 +08:00
terry-xiaoyu a904031979 acl cache using proc_dict 2018-08-26 13:30:18 +08:00
Feng Lee 68cfcf6e0e Pass paho mqtt interoperability tests 2018-08-24 23:19:11 +08:00
Feng Lee 694485252a Merge branch 'emqx30-dev' of github.com:emqtt/emqttd into emqx30-dev 2018-08-24 18:43:36 +08:00
Feng Lee 0f052ce352 Upgrade connection, protocol and session modules for MQTT 5.0 2018-08-24 18:39:59 +08:00
turtled 22e8b07a3d Receive/send messages by bridge 2018-08-19 20:31:44 +08:00
Feng Lee d9004d4cfb Add MQTT section in configuration file 2018-08-10 12:43:32 +08:00
Feng Lee 3ac4be84e4 Remove 'listener.wss.external.handshake_timeout' for cowboy does not support this option 2018-08-09 14:26:39 +08:00
Feng Lee e23a6e87d8 Merge listeners, zones, bridges config 2018-08-08 19:37:57 +08:00