add 'sys' flag for mqtt_message

This commit is contained in:
Feng Lee 2015-05-31 11:38:26 +08:00
parent 824078c6b8
commit 73cb2389d9
4 changed files with 24 additions and 48 deletions

View File

@ -61,6 +61,8 @@
qos = ?QOS_0 :: mqtt_qos(),
retain = false :: boolean(),
dup = false :: boolean(),
%% $SYS message flag
sys = false :: boolean(),
msgid :: mqtt_msgid(),
payload :: binary()
}).

View File

@ -1,40 +0,0 @@
%%%-----------------------------------------------------------------------------
%%% Copyright (c) 2012-2015 eMQTT.IO, All Rights Reserved.
%%%
%%% 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.
%%%-----------------------------------------------------------------------------
%%% @doc
%%% emqttd cluster to monitor clusted nodes.
%%%
%%% @end
%%%-----------------------------------------------------------------------------
-module(emqttd_cluster).
-author("Feng Lee <feng@emqtt.io>").
-export([running_nodes/0]).
%%------------------------------------------------------------------------------
%% @doc Get running nodes
%% @end
%%------------------------------------------------------------------------------
%%TODO: remove...
running_nodes() ->
mnesia:system_info(running_db_nodes).

View File

@ -26,6 +26,8 @@
%%%-----------------------------------------------------------------------------
-module(emqttd_mod_presence).
-author("Feng Lee <feng@emqtt.io>").
-include_lib("emqtt/include/emqtt.hrl").
-include("emqttd.hrl").

View File

@ -1,4 +1,4 @@
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
h% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[{kernel,
[{start_timer, true},
@ -87,13 +87,25 @@
]},
%% Session
{session, [
%% Expired after 24 hours
{expires, 24},
%% Max offline message queue
{max_queue, 100},
%% Store Qos0?
{store_qos0, false}
]}
%% Expired after 2 days
{expired_after, 48},
%% Max number of QoS 1 and 2 messages that can be “in flight” at one time.
{max_inflight_messages, 20},
%% Max retries for unacknolege Qos1/2 messages
{max_unack_retries, 3},
%% Retry after 10 seconds
{unack_retry_after, 10}
]},
{queue, [
%% Max messages queued when client is disconnected, or inflight messsages is overload
{max_queued_messages, 100},
%% High watermark of queued messsages
{high_queue_watermark, 0.6},
%% Low watermark of queued messsages
{low_queue_watermark, 0.2},
%% Queue Qos0 offline messages?
{queue_qos0_messages, false}
]},
]},
%% Broker Options
{broker, [