Merge remote-tracking branch 'origin/develop'

This commit is contained in:
zhanghongtong 2019-04-18 03:53:43 +08:00
commit 1fbc50530a
3 changed files with 7 additions and 7 deletions

View File

@ -2122,7 +2122,7 @@ broker.session_locking_strategy = quorum
##
## Value: Enum
## - random
## - round_robbin
## - round_robin
## - sticky
## - hash
broker.shared_subscription_strategy = random

View File

@ -1996,11 +1996,11 @@ end}.
%% @doc Shared Subscription Dispatch Strategy.
{mapping, "broker.shared_subscription_strategy", "emqx.shared_subscription_strategy", [
{default, round_robbin},
{default, round_robin},
{datatype,
{enum,
[random, %% randomly pick a subscriber
round_robbin, %% round robin alive subscribers one message after another
round_robin, %% round robin alive subscribers one message after another
sticky, %% pick a random subscriber and stick to it
hash %% hash client ID to a group member
]}}
@ -2125,4 +2125,4 @@ end}.
[{check_interval, cuttlefish:conf_get("vm_mon.check_interval", Conf)},
{process_high_watermark, cuttlefish:conf_get("vm_mon.process_high_watermark", Conf)},
{process_low_watermark, cuttlefish:conf_get("vm_mon.process_low_watermark", Conf)}]
end}.
end}.

View File

@ -503,7 +503,7 @@ init([{username, Username} | Opts], State) ->
init([{password, Password} | Opts], State) ->
init(Opts, State#state{password = iolist_to_binary(Password)});
init([{keepalive, Secs} | Opts], State) ->
init(Opts, State#state{keepalive = timer:seconds(Secs)});
init(Opts, State#state{keepalive = Secs});
init([{proto_ver, v3} | Opts], State) ->
init(Opts, State#state{proto_ver = ?MQTT_PROTO_V3,
proto_name = <<"MQIsdp">>});
@ -1026,11 +1026,11 @@ publish_process(?QOS_2, Packet = ?PUBLISH_PACKET(?QOS_2, PacketId),
end.
ensure_keepalive_timer(State = ?PROPERTY('Server-Keep-Alive', Secs)) ->
ensure_keepalive_timer(timer:seconds(Secs), State);
ensure_keepalive_timer(timer:seconds(Secs), State#state{keepalive = Secs});
ensure_keepalive_timer(State = #state{keepalive = 0}) ->
State;
ensure_keepalive_timer(State = #state{keepalive = I}) ->
ensure_keepalive_timer(I, State).
ensure_keepalive_timer(timer:seconds(I), State).
ensure_keepalive_timer(I, State) when is_integer(I) ->
State#state{keepalive_timer = erlang:start_timer(I, self(), keepalive)}.