feat(exclusive): update schema and conf

This commit is contained in:
firest 2022-06-23 15:56:47 +08:00
parent 7084e510d6
commit 746b996de4
3 changed files with 19 additions and 3 deletions

View File

@ -742,6 +742,11 @@ mqtt.wildcard_subscription = true
## Value: boolean ## Value: boolean
mqtt.shared_subscription = true mqtt.shared_subscription = true
## Whether the Server supports MQTT Exclusive Subscriptions.
##
## Value: boolean
mqtt.exclusive_subscription = false
## Whether to ignore loop delivery of messages.(for mqtt v3.1.1) ## Whether to ignore loop delivery of messages.(for mqtt v3.1.1)
## ##
## Value: true | false ## Value: true | false
@ -847,6 +852,11 @@ zone.external.force_gc_policy = 16000|16MB
## Value: boolean ## Value: boolean
## zone.external.shared_subscription = false ## zone.external.shared_subscription = false
## Whether the Server supports MQTT Exclusive Subscriptions.
##
## Value: boolean
## zone.external.exclusive_subscription = false
## Server Keep Alive ## Server Keep Alive
## ##
## Value: Number ## Value: Number
@ -1049,6 +1059,11 @@ zone.internal.acl_deny_action = ignore
## Value: boolean ## Value: boolean
## zone.internal.shared_subscription = true ## zone.internal.shared_subscription = true
## Whether the Server supports MQTT Exclusive Subscriptions.
##
## Value: boolean
## zone.internal.exclusive_subscription = false
## See zone.$name.max_subscriptions. ## See zone.$name.max_subscriptions.
## ##
## Value: Integer ## Value: Integer

View File

@ -946,8 +946,8 @@ end}.
]}. ]}.
%% @doc Whether the Server supports Exclusive Subscriptions. %% @doc Whether the Server supports Exclusive Subscriptions.
{mapping, "mqtt.shared_subscription", "emqx.exclusive_subscription", [ {mapping, "mqtt.exclusive_subscription", "emqx.exclusive_subscription", [
{default, true}, {default, false},
{datatype, {enum, [true, false]}} {datatype, {enum, [true, false]}}
]}. ]}.
@ -1207,6 +1207,7 @@ end}.
%% @doc Whether the Server supports Exclusive Subscriptions. %% @doc Whether the Server supports Exclusive Subscriptions.
{mapping, "zone.$name.exclusive_subscription", "emqx.zones", [ {mapping, "zone.$name.exclusive_subscription", "emqx.zones", [
{default, false},
{datatype, {enum, [true, false]}} {datatype, {enum, [true, false]}}
]}. ]}.

View File

@ -86,7 +86,7 @@ unsubscribe(_Topic, _SubOpts) ->
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Internal functions %% Internal functions
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
try_subscribe(Topic, ClientId) -> try_subscribe(ClientId, Topic) ->
case mnesia:wread({?TAB, Topic}) of case mnesia:wread({?TAB, Topic}) of
[] -> [] ->
mnesia:write( mnesia:write(