Sfoglia il codice sorgente

fix(conf): change `max_topic_levels` default configuration

JimMoen 4 anni fa
parent
commit
289415b5aa
3 ha cambiato i file con 9 aggiunte e 7 eliminazioni
  1. 7 4
      etc/emqx.conf
  2. 1 1
      priv/emqx.schema
  3. 1 2
      test/emqx_channel_SUITE.erl

+ 7 - 4
etc/emqx.conf

@@ -663,9 +663,11 @@ mqtt.max_packet_size = 1MB
 mqtt.max_clientid_len = 65535
 
 ## Maximum topic levels allowed. 0 means no limit.
+## Depth so big may lead to subscribing performance issues.
 ##
-## Value: Number
-mqtt.max_topic_levels = 0
+## Value: Number [0-65535]
+## Default: 128
+mqtt.max_topic_levels = 128
 
 ## Maximum QoS allowed.
 ##
@@ -769,8 +771,9 @@ zone.external.force_gc_policy = 16000|16MB
 
 ## Maximum topic levels allowed. 0 means no limit.
 ##
-## Value: Number
-## zone.external.max_topic_levels = 7
+## Value: Number [0-65535]
+## Default: 7
+zone.external.max_topic_levels = 7
 
 ## Maximum QoS allowed.
 ##

+ 1 - 1
priv/emqx.schema

@@ -800,7 +800,7 @@ end}.
 
 %% @doc Set the Maximum topic levels.
 {mapping, "mqtt.max_topic_levels", "emqx.max_topic_levels", [
-  {default, 0},
+  {default, 128},
   {datatype, integer}
 ]}.
 

+ 1 - 2
test/emqx_channel_SUITE.erl

@@ -83,7 +83,7 @@ t_chan_caps(_) ->
      #{max_clientid_len := 65535,
        max_qos_allowed := 2,
        max_topic_alias := 65535,
-       max_topic_levels := 0,
+       max_topic_levels := 128,
        retain_available := true,
        shared_subscription := true,
        subscription_identifiers := true,
@@ -835,4 +835,3 @@ session(InitFields) when is_map(InitFields) ->
 quota() ->
     emqx_limiter:init(zone, [{conn_messages_routing, {5, 1}},
                              {overall_messages_routing, {10, 1}}]).
-