diff --git a/apps/emqtt/include/emqtt.hrl b/apps/emqtt/include/emqtt.hrl index 1184aab01..bbd1f95c4 100644 --- a/apps/emqtt/include/emqtt.hrl +++ b/apps/emqtt/include/emqtt.hrl @@ -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() }). diff --git a/apps/emqttd/src/emqttd_cluster.erl b/apps/emqttd/src/emqttd_cluster.erl deleted file mode 100644 index bd5a1a2ac..000000000 --- a/apps/emqttd/src/emqttd_cluster.erl +++ /dev/null @@ -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 "). - --export([running_nodes/0]). - -%%------------------------------------------------------------------------------ -%% @doc Get running nodes -%% @end -%%------------------------------------------------------------------------------ -%%TODO: remove... -running_nodes() -> - mnesia:system_info(running_db_nodes). - diff --git a/apps/emqttd/src/emqttd_mod_presence.erl b/apps/emqttd/src/emqttd_mod_presence.erl index 981cb4350..3e5dbccb2 100644 --- a/apps/emqttd/src/emqttd_mod_presence.erl +++ b/apps/emqttd/src/emqttd_mod_presence.erl @@ -26,6 +26,8 @@ %%%----------------------------------------------------------------------------- -module(emqttd_mod_presence). +-author("Feng Lee "). + -include_lib("emqtt/include/emqtt.hrl"). -include("emqttd.hrl"). diff --git a/rel/files/emqttd.config b/rel/files/emqttd.config index 39e92334e..977101cce 100644 --- a/rel/files/emqttd.config +++ b/rel/files/emqttd.config @@ -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, [