Merge branch 'master' into dev

This commit is contained in:
Feng Lee 2015-01-08 22:10:47 +08:00
commit 0a4a241be1
5 changed files with 61 additions and 22 deletions

View File

@ -1,10 +1,20 @@
eMQTT ChangeLog 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) 0.2.0 (2014-12-07)
------------------- -------------------

View File

@ -1,9 +1,9 @@
all: dep compile all: get-deps compile
compile: dep compile: get-deps
./rebar compile ./rebar compile
dep: get-deps:
./rebar get-deps ./rebar get-deps
clean: clean:

View File

@ -9,15 +9,15 @@ eMQTT requires Erlang R17+.
## Startup in Five Minutes ## 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 ## Deploy and Start
@ -25,18 +25,18 @@ eMQTT requires Erlang R17+.
### start ### 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 ### stop
``` ```
./bin/emqtt stop ./bin/emqtt stop
``` ```
@ -77,7 +77,25 @@ When nodes clustered, vm.args should be configured as below:
-name emqtt@host1 -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 ## Cluster
@ -106,13 +124,13 @@ eMQTT support http to publish message.
Example: 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 ### URL
``` ```
HTTP POST http://host:8883/mqtt/publish HTTP POST http://host:8883/mqtt/publish
``` ```
### Parameters ### Parameters
@ -124,7 +142,7 @@ message | Text Message
## Design ## Design
[Design Wiki](https://github.com/slimpp/emqtt/wiki) [Design Wiki](https://github.com/emqtt/emqtt/wiki)
## License ## License
@ -132,5 +150,10 @@ The MIT License (MIT)
## Author ## Author
feng at slimchat.io feng at emqtt.io
## Thanks
@hejin1026 (260495915 at qq.com)
@desoulter (assoulter123 at gmail.com)

6
TODO
View File

@ -1,3 +1,9 @@
0.2.2
=====
merge pull request#26
0.2.0 0.2.0
===== =====

View File

@ -247,10 +247,10 @@ trie_match(NodeId, [W|Words], ResAcc) ->
[#topic_trie{node_id=ChildId}] -> trie_match(ChildId, Words, Acc); [#topic_trie{node_id=ChildId}] -> trie_match(ChildId, Words, Acc);
[] -> Acc [] -> Acc
end end
end, 'trie_match_#'(NodeId, ResAcc), [W, "+"]). end, 'trie_match_#'(NodeId, ResAcc), [W, <<"+">>]).
'trie_match_#'(NodeId, ResAcc) -> '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}] -> [#topic_trie{node_id=ChildId}] ->
mnesia:read(topic_trie_node, ChildId) ++ ResAcc; mnesia:read(topic_trie_node, ChildId) ++ ResAcc;
[] -> [] ->