Go to file
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
.github TEMPLATE 2016-11-10 17:26:02 +08:00
docs Upgrade connection, protocol and session modules for MQTT 5.0 2018-08-24 18:39:59 +08:00
etc Change the start_link API for emqx_client 2018-11-09 17:43:04 +08:00
include Replace macro QOS$i to QOS_$I 2018-11-08 20:42:31 +08:00
priv Change the start_link API for emqx_client 2018-11-09 17:43:04 +08:00
src Change the start_link API for emqx_client 2018-11-09 17:43:04 +08:00
test Change the start_link API for emqx_client 2018-11-09 17:43:04 +08:00
.editorconfig add editorconfig for emqx 2018-09-03 14:03:20 +08:00
.gitignore Rewrite emqx_gc.erl 2018-09-21 22:56:34 +08:00
.travis.yml Upload coveralls data only when sucess 2018-09-25 22:09:13 +08:00
erlang.mk Fixed test case compilation error 2018-08-26 22:25:54 +08:00
LICENSE Licensed under the Apache, Version 2.0 2016-02-05 14:26:17 +08:00
Makefile Remove neotoma plugin, build cuttlefish script in sub-dir 2018-10-27 14:21:53 +02:00
README.md Update README.md 2018-10-04 12:17:28 +08:00
rebar.config Remove neotoma plugin, build cuttlefish script in sub-dir 2018-10-27 14:21:53 +02:00
rebar.config.script Fix travis build 2018-09-14 00:52:03 +08:00
vars Generate a config file for testing 2018-09-07 07:04:04 +02:00

EMQ X Broker

EMQ X broker is a fully open source, highly scalable, highly available distributed MQTT messaging broker for IoT, M2M and Mobile applications that can handle tens of millions of concurrent clients.

Starting from 3.0 release, EMQ X broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1, as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the EMQ X broker can scaled to 10+ million concurrent MQTT connections on one cluster.

Installation

The EMQ X broker is cross-platform, which can be deployed on Linux, Unix, Mac, Windows and even Raspberry Pi.

Download the binary package for your platform from here.

Build From Source

The EMQ X broker requires Erlang/OTP R21+ to build since 3.0 release.

git clone https://github.com/emqx/emqx-rel.git

cd emqx-rel && make

cd _rel/emqx && ./bin/emqx console

Quick Start

# Start emqx
./bin/emqx start

# Check Status
./bin/emqx_ctl status

# Stop emqx
./bin/emqx stop

To view the dashboard after running, use your browser to open: http://localhost:18083

Roadmap

The EMQ X Roadmap uses Github milestones to track the progress of the project.

Community, discussion, contribution, and support

You can reach the EMQ community and developers via the following channels:

Please submit any bugs, issues, and feature requests to emqx/emqx.

License

Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.