diff --git a/CHANGELOG.md b/CHANGELOG.md index dccdaa143..9011e9dc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,20 @@ eMQTT ChangeLog ================== -TODO: 0.2.1 (2014-12-31) -------------------- +v0.2.1-beta (2015-01-08) +------------------------ -Pass MQTT 3.1.1 Tests +pull request 26: Use binaries for topic paths and fix wildcard topics + +emqtt_pubsub.erl: fix wildcard topic match bug caused by binary topic in 0.2.0 + +Makefile: deps -> get-deps + +rebar.config: fix mochiweb git url + +tag emqtt release accoding to [Semantic Versioning](http://semver.org/) + +max clientId length is 1024 now. 0.2.0 (2014-12-07) ------------------- diff --git a/Makefile b/Makefile index 72e436459..6adbf3bf0 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -all: dep compile +all: get-deps compile -compile: dep +compile: get-deps ./rebar compile -dep: +get-deps: ./rebar get-deps clean: diff --git a/README.md b/README.md index 44bedc77d..c4e51fa93 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,15 @@ eMQTT requires Erlang R17+. ## Startup in Five Minutes ``` - $ git clone git://github.com/slimpp/emqtt.git +$ git clone git://github.com/slimpp/emqtt.git - $ cd emqtt +$ cd emqtt - $ make && make dist +$ make && make dist - $ cd rel/emqtt +$ cd rel/emqtt - $ ./bin/emqtt console +$ ./bin/emqtt console ``` ## Deploy and Start @@ -25,18 +25,18 @@ eMQTT requires Erlang R17+. ### start ``` - cp -R rel/emqtt $INSTALL_DIR +cp -R rel/emqtt $INSTALL_DIR - cd $INSTALL_DIR/emqtt +cd $INSTALL_DIR/emqtt - ./bin/emqtt start +./bin/emqtt start ``` ### stop ``` - ./bin/emqtt stop +./bin/emqtt stop ``` @@ -77,7 +77,25 @@ 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. ## Cluster @@ -106,13 +124,13 @@ eMQTT support http to publish message. Example: ``` - curl -v --basic -u user:passwd -d "topic=/a/b/c&message=hello from http..." -k http://localhost:8883/mqtt/publish +curl -v --basic -u user:passwd -d "topic=/a/b/c&message=hello from http..." -k http://localhost:8883/mqtt/publish ``` ### URL ``` - HTTP POST http://host:8883/mqtt/publish +HTTP POST http://host:8883/mqtt/publish ``` ### Parameters @@ -124,7 +142,7 @@ message | Text Message ## Design -[Design Wiki](https://github.com/slimpp/emqtt/wiki) +[Design Wiki](https://github.com/emqtt/emqtt/wiki) ## License @@ -132,5 +150,10 @@ The MIT License (MIT) ## Author -feng at slimchat.io +feng at emqtt.io + +## Thanks + +@hejin1026 (260495915 at qq.com) +@desoulter (assoulter123 at gmail.com) diff --git a/TODO b/TODO index e7722c346..f3528d7e5 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,9 @@ + +0.2.2 +===== + +merge pull request#26 + 0.2.0 ===== diff --git a/apps/emqtt/src/emqtt_pubsub.erl b/apps/emqtt/src/emqtt_pubsub.erl index 0b8c5f372..44be24bbb 100644 --- a/apps/emqtt/src/emqtt_pubsub.erl +++ b/apps/emqtt/src/emqtt_pubsub.erl @@ -247,10 +247,10 @@ trie_match(NodeId, [W|Words], ResAcc) -> [#topic_trie{node_id=ChildId}] -> trie_match(ChildId, Words, Acc); [] -> Acc end - end, 'trie_match_#'(NodeId, ResAcc), [W, "+"]). + end, 'trie_match_#'(NodeId, ResAcc), [W, <<"+">>]). 'trie_match_#'(NodeId, ResAcc) -> - case mnesia:read(topic_trie, #topic_trie_edge{node_id=NodeId, word="#"}) of + case mnesia:read(topic_trie, #topic_trie_edge{node_id=NodeId, word = <<"#">>}) of [#topic_trie{node_id=ChildId}] -> mnesia:read(topic_trie_node, ChildId) ++ ResAcc; [] ->