create emqx project

Feng Lee e1a1a9ea5f ------ 11 tahun lalu
apps 665e7cb26d 0.4.0 11 tahun lalu
data c9d3e2d291 mqtt 3.1.1 protocol 11 tahun lalu
deps 3a6ed9a876 0.2 project structure 11 tahun lalu
doc 47df4055f3 v0.4.0 11 tahun lalu
plugins 7213e81fb3 auth 11 tahun lalu
rel 82772e4e38 broker metrics 11 tahun lalu
scripts f3057c08e4 0.3.0 changes 11 tahun lalu
tests 68eb225981 add tests 11 tahun lalu
.gitignore a0017c3186 author 11 tahun lalu
.gitmodules 68eb225981 add tests 11 tahun lalu
.travis.yml db6d9cc49b add 11 tahun lalu
CHANGELOG.md e1a1a9ea5f ------ 11 tahun lalu
LICENSE 6ff4f59a25 frame -> packet 11 tahun lalu
Makefile 2d2aa2f79a upgrade esockd, mochiweb 11 tahun lalu
README.md 8060a727b8 listen mqtts 11 tahun lalu
TODO 9512b18c53 merge emqttc 11 tahun lalu
go 8cc8046a02 add 11 tahun lalu
rebar 2d2aa2f79a upgrade esockd, mochiweb 11 tahun lalu
rebar.config e2c1eda808 client -> clients 11 tahun lalu

README.md

eMQTT Build Status

eMQTT is a clusterable, massively scalable, fault-tolerant and extensible MQTT V3.1/V3.1.1 broker written in Erlang/OTP.

eMQTT support MQTT V3.1/V3.1.1 Protocol Specification.

eMQTT requires Erlang R17+.

Startup in Five Minutes

$ git clone git://github.com/emqtt/emqtt.git

$ cd emqtt

$ make && make dist

$ cd rel/emqtt

$ ./bin/emqtt console

Deploy and Start

start

cp -R rel/emqtt $INSTALL_DIR

cd $INSTALL_DIR/emqtt

./bin/emqtt start

stop

./bin/emqtt stop

Configuration

etc/app.config

 {emqtt, [
    {auth, {anonymous, []}}, %internal, anonymous
    {listen, [
        {mqtt, 1883, [
            {max_clients, 1024},
            {acceptor_pool, 4}
        ]},
        {mqtts, 8883, [
            {max_clients, 1024},
            {acceptor_pool, 4},
            %{cacertfile, "etc/ssl/cacert.pem"}, 
            {ssl, [{certfile, "etc/ssl.crt"},
                   {keyfile,  "etc/ssl.key"}]}
        ]},
        {http, 8083, [
            {max_clients, 512},
            {acceptor_pool, 1}
        ]}
    ]}
 ]}

etc/vm.args


-name emqtt@127.0.0.1

-setcookie emqtt

When nodes clustered, vm.args should be configured as below:

-name emqtt@host1

Cluster

Suppose we cluster two nodes on 'host1', 'host2', Steps:

on 'host1':

./bin/emqtt start

on 'host2':

./bin/emqtt start

./bin/emqtt_ctl cluster emqtt@host1

Run './bin/emqtt_ctl cluster' on 'host1' or 'host2' to check cluster nodes.

HTTP API

eMQTT support http to publish message.

Example:

curl -v --basic -u user:passwd -d "qos=1&retain=0&topic=/a/b/c&message=hello from http..." -k http://localhost:8083/mqtt/publish

URL

HTTP POST http://host:8083/mqtt/publish

Parameters

Name Description
qos QoS(0, 1, 2)
retain Retain(0, 1)
topic Topic
message Message

Design

Design Wiki

License

The MIT License (MIT)

Author

feng at emqtt.io

Thanks

@hejin1026 (260495915 at qq.com)

@desoulter (assoulter123 at gmail.com)