Procházet zdrojové kódy

fix(conf): change `max_topic_levels` default configuration

JimMoen před 4 roky
rodič
revize
f74e34b6a5

+ 3 - 2
apps/emqx/etc/emqx.conf

@@ -577,8 +577,9 @@ mqtt {
   ## @doc mqtt.max_topic_levels
   ## ValueType: Integer
   ## Range: [1, 65535]
-  ## Default: 65535
-  max_topic_levels = 65535
+  ## Default: 128
+  ## Depth so big may lead to subscribing performance issues
+  max_topic_levels = 128
 
   ## Maximum QoS allowed.
   ##

+ 2 - 2
apps/emqx/test/emqx_channel_SUITE.erl

@@ -59,7 +59,7 @@ mqtt_conf() ->
       max_inflight => 32,max_mqueue_len => 1000,
       max_packet_size => 1048576,max_qos_allowed => 2,
       max_subscriptions => infinity,max_topic_alias => 65535,
-      max_topic_levels => 65535,mqueue_default_priority => lowest,
+      max_topic_levels => 128,mqueue_default_priority => lowest,
       mqueue_priorities => disabled,mqueue_store_qos0 => true,
       peer_cert_as_clientid => disabled,
       peer_cert_as_username => disabled,
@@ -200,7 +200,7 @@ t_chan_caps(_) ->
      #{max_clientid_len := 65535,
        max_qos_allowed := 2,
        max_topic_alias := 65535,
-       max_topic_levels := 65535,
+       max_topic_levels := 128,
        retain_available := true,
        shared_subscription := true,
        subscription_identifiers := true,