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 ## Value: Enum
## - random ## - random
## - round_robbin ## - round_robin
## - sticky ## - sticky
## - hash ## - hash
broker.shared_subscription_strategy = random broker.shared_subscription_strategy = random

View File

@ -1996,11 +1996,11 @@ end}.
%% @doc Shared Subscription Dispatch Strategy. %% @doc Shared Subscription Dispatch Strategy.
{mapping, "broker.shared_subscription_strategy", "emqx.shared_subscription_strategy", [ {mapping, "broker.shared_subscription_strategy", "emqx.shared_subscription_strategy", [
{default, round_robbin}, {default, round_robin},
{datatype, {datatype,
{enum, {enum,
[random, %% randomly pick a subscriber [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 sticky, %% pick a random subscriber and stick to it
hash %% hash client ID to a group member hash %% hash client ID to a group member
]}} ]}}
@ -2125,4 +2125,4 @@ end}.
[{check_interval, cuttlefish:conf_get("vm_mon.check_interval", Conf)}, [{check_interval, cuttlefish:conf_get("vm_mon.check_interval", Conf)},
{process_high_watermark, cuttlefish:conf_get("vm_mon.process_high_watermark", 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)}] {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([{password, Password} | Opts], State) ->
init(Opts, State#state{password = iolist_to_binary(Password)}); init(Opts, State#state{password = iolist_to_binary(Password)});
init([{keepalive, Secs} | Opts], State) -> 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([{proto_ver, v3} | Opts], State) ->
init(Opts, State#state{proto_ver = ?MQTT_PROTO_V3, init(Opts, State#state{proto_ver = ?MQTT_PROTO_V3,
proto_name = <<"MQIsdp">>}); proto_name = <<"MQIsdp">>});
@ -1026,11 +1026,11 @@ publish_process(?QOS_2, Packet = ?PUBLISH_PACKET(?QOS_2, PacketId),
end. end.
ensure_keepalive_timer(State = ?PROPERTY('Server-Keep-Alive', Secs)) -> 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}) -> ensure_keepalive_timer(State = #state{keepalive = 0}) ->
State; State;
ensure_keepalive_timer(State = #state{keepalive = I}) -> 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) -> ensure_keepalive_timer(I, State) when is_integer(I) ->
State#state{keepalive_timer = erlang:start_timer(I, self(), keepalive)}. State#state{keepalive_timer = erlang:start_timer(I, self(), keepalive)}.