Merge branch 'dev' of github.com:emqtt/emqtt into dev
This commit is contained in:
commit
89553dff69
|
@ -15,6 +15,7 @@ Change: fix emqtt_pubsub.erl to match '#', '+'
|
||||||
|
|
||||||
Tests: emqtt_topic_tests.erl add more test cases
|
Tests: emqtt_topic_tests.erl add more test cases
|
||||||
|
|
||||||
|
|
||||||
v0.3.0-alpha (2015-01-18)
|
v0.3.0-alpha (2015-01-18)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
|
20
README.md
20
README.md
|
@ -97,26 +97,6 @@ on 'host2':
|
||||||
|
|
||||||
Run './bin/emqtt_ctl cluster' on 'host1' or 'host2' to check cluster nodes.
|
Run './bin/emqtt_ctl cluster' on 'host1' or 'host2' to check cluster nodes.
|
||||||
|
|
||||||
## Cluster
|
|
||||||
|
|
||||||
Suppose we cluster two nodes on 'host1', 'host2', steps:
|
|
||||||
|
|
||||||
on 'host1':
|
|
||||||
|
|
||||||
```
|
|
||||||
./bin/emqtt start
|
|
||||||
```
|
|
||||||
|
|
||||||
on 'host2':
|
|
||||||
|
|
||||||
```
|
|
||||||
./bin/emqtt start
|
|
||||||
|
|
||||||
./bin/emqtt cluster emqtt@host1
|
|
||||||
```
|
|
||||||
|
|
||||||
Run './bin/emqtt cluster' on 'host1' or 'host2' to check cluster nodes.
|
|
||||||
|
|
||||||
## HTTP API
|
## HTTP API
|
||||||
|
|
||||||
eMQTT support http to publish message.
|
eMQTT support http to publish message.
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
-record(topic_trie_node, {
|
-record(topic_trie_node, {
|
||||||
node_id :: binary() | atom(),
|
node_id :: binary() | atom(),
|
||||||
edge_count = 0 :: non_neg_integer(),
|
edge_count = 0 :: non_neg_integer(),
|
||||||
topic :: binary()
|
topic :: binary(),
|
||||||
|
type = dynamic :: dynamic | static
|
||||||
}).
|
}).
|
||||||
|
|
||||||
-record(topic_trie_edge, {
|
-record(topic_trie_edge, {
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
%%-----------------------------------------------------------------------------
|
||||||
|
%% Copyright (c) 2012-2015, Feng Lee <feng@emqtt.io>
|
||||||
|
%%
|
||||||
|
%% Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
%% of this software and associated documentation files (the "Software"), to deal
|
||||||
|
%% in the Software without restriction, including without limitation the rights
|
||||||
|
%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
%% copies of the Software, and to permit persons to whom the Software is
|
||||||
|
%% furnished to do so, subject to the following conditions:
|
||||||
|
%%
|
||||||
|
%% The above copyright notice and this permission notice shall be included in all
|
||||||
|
%% copies or substantial portions of the Software.
|
||||||
|
%%
|
||||||
|
%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
%% SOFTWARE.
|
||||||
|
%%------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-module(emqtt_bridge_sup).
|
||||||
|
|
||||||
|
-author('feng@emqtt.io').
|
||||||
|
|
||||||
|
-behavior(supervisor).
|
||||||
|
|
||||||
|
-export([start_link/0, start_bridge/2, stop_bridge/1, init/1]).
|
||||||
|
|
||||||
|
start_link() ->
|
||||||
|
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||||
|
|
||||||
|
%%TODO: FIXME LATER.
|
||||||
|
start_bridge(Name, Opts) when is_atom(Name) ->
|
||||||
|
supervisor:start_child(?MODULE, {{bridge, Name},
|
||||||
|
{eqmtt_bridge, start_link, [Opts]},
|
||||||
|
transient, 16#fffff, worker, [emqtt_bridge]}).
|
||||||
|
|
||||||
|
stop_bridge(Name) ->
|
||||||
|
ChildId = {bridge, Name},
|
||||||
|
case supervisor:terminate_child(?MODULE, ChildId) of
|
||||||
|
ok ->
|
||||||
|
supervisor:delete_child(?MODULE, ChildId);
|
||||||
|
{error, Reason} ->
|
||||||
|
{error, Reason}
|
||||||
|
end.
|
||||||
|
|
||||||
|
init([]) ->
|
||||||
|
{ok, {{one_for_one, 10, 1000}, []}}.
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Broker Topics
|
||||||
|
|
||||||
|
## Version
|
||||||
|
|
||||||
|
$SYS/broker/version
|
||||||
|
|
||||||
|
## Uptime
|
||||||
|
|
||||||
|
$SYS/broker/uptime
|
||||||
|
|
||||||
|
## Recevied and Sent
|
||||||
|
|
||||||
|
$SYS/broker/bytes/received
|
||||||
|
$SYS/broker/bytes/sent
|
||||||
|
|
||||||
|
$SYS/broker/packets/received
|
||||||
|
$SYS/broker/packets/sent
|
||||||
|
|
||||||
|
$SYS/broker/messages/received
|
||||||
|
$SYS/broker/messages/sent
|
||||||
|
$SYS/broker/messages/retained
|
||||||
|
$SYS/broker/messages/stored
|
||||||
|
$SYS/broker/messages/dropped
|
||||||
|
|
||||||
|
## Client Presence
|
||||||
|
|
||||||
|
$SYS/broker/clients/connected
|
||||||
|
$SYS/broker/clients/disconnected
|
||||||
|
|
||||||
|
$SYS/broker/clients/${clientId}/presences/online
|
||||||
|
$SYS/broker/clients/${clientId}presences/offline
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,9 @@
|
||||||
]}
|
]}
|
||||||
]},
|
]},
|
||||||
{emqtt, [
|
{emqtt, [
|
||||||
{auth, {anonymous, []}}, %internal, anonymous
|
%Authetication. Internal, Anonymous Default.
|
||||||
|
{auth, {anonymous, []}},
|
||||||
|
{access, []},
|
||||||
{session, [
|
{session, [
|
||||||
{expires, 1},
|
{expires, 1},
|
||||||
{max_queue, 1000},
|
{max_queue, 1000},
|
||||||
|
|
Loading…
Reference in New Issue