add 'sys' flag for mqtt_message
This commit is contained in:
parent
824078c6b8
commit
73cb2389d9
|
@ -61,6 +61,8 @@
|
||||||
qos = ?QOS_0 :: mqtt_qos(),
|
qos = ?QOS_0 :: mqtt_qos(),
|
||||||
retain = false :: boolean(),
|
retain = false :: boolean(),
|
||||||
dup = false :: boolean(),
|
dup = false :: boolean(),
|
||||||
|
%% $SYS message flag
|
||||||
|
sys = false :: boolean(),
|
||||||
msgid :: mqtt_msgid(),
|
msgid :: mqtt_msgid(),
|
||||||
payload :: binary()
|
payload :: binary()
|
||||||
}).
|
}).
|
||||||
|
|
|
@ -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).
|
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
%%%-----------------------------------------------------------------------------
|
%%%-----------------------------------------------------------------------------
|
||||||
-module(emqttd_mod_presence).
|
-module(emqttd_mod_presence).
|
||||||
|
|
||||||
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include_lib("emqtt/include/emqtt.hrl").
|
-include_lib("emqtt/include/emqtt.hrl").
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
|
|
|
@ -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
|
%% ex: ft=erlang ts=4 sw=4 et
|
||||||
[{kernel,
|
[{kernel,
|
||||||
[{start_timer, true},
|
[{start_timer, true},
|
||||||
|
@ -87,13 +87,25 @@
|
||||||
]},
|
]},
|
||||||
%% Session
|
%% Session
|
||||||
{session, [
|
{session, [
|
||||||
%% Expired after 24 hours
|
%% Expired after 2 days
|
||||||
{expires, 24},
|
{expired_after, 48},
|
||||||
%% Max offline message queue
|
%% Max number of QoS 1 and 2 messages that can be “in flight” at one time.
|
||||||
{max_queue, 100},
|
{max_inflight_messages, 20},
|
||||||
%% Store Qos0?
|
%% Max retries for unacknolege Qos1/2 messages
|
||||||
{store_qos0, false}
|
{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 Options
|
||||||
{broker, [
|
{broker, [
|
||||||
|
|
Loading…
Reference in New Issue