mqtt.conf.example 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ## MQTT protocol related settings
  2. ## Settings in this section is applied globally to all MQTT connections/sessions in this node
  3. mqtt {
  4. ## After the TCP connection is established,
  5. ## if the MQTT CONNECT packet from the client is not received within the time specified by idle_timeout, the connection will be disconnected
  6. ## Type:
  7. ## - infinity :: Never disconnect
  8. ## - Time Duration :: The idle time
  9. idle_timeout = 15s
  10. ## Maximum MQTT packet size allowed
  11. max_packet_size = 1MB
  12. ## Maximum allowed length of MQTT Client ID
  13. ## Type: Rnage from 23 to 65535
  14. max_clientid_len = 65535
  15. ## Maximum topic levels allowed
  16. ## Type: Range from 1 to 65535
  17. max_topic_levels = 128
  18. ## Maximum QoS allowed
  19. max_qos_allowed = 2
  20. ## Maximum topic alias, 0 means no topic alias supported
  21. ## Type: Range from 0 to 65535
  22. max_topic_alias = 65535
  23. ## Whether to enable support for MQTT retained message
  24. retain_available = true
  25. ## Whether to enable support for MQTT wildcard subscription
  26. wildcard_subscription = true
  27. ## Whether to enable support for MQTT shared subscription
  28. shared_subscription = true
  29. ## Whether to enable support for MQTT exclusive subscription
  30. exclusive_subscription = false
  31. ## Ignore loop delivery of messages for MQTT v3.1.1/v3.1.0, similar to No Local subscription option in MQTT 5.0
  32. ignore_loop_deliver = false
  33. ## Parse MQTT messages in strict mode.
  34. ## When set to true, invalid utf8 strings in for example client ID, topic name, etc. will cause the client to be disconnected
  35. strict_mode = false
  36. ## Specify the response information returned to the client
  37. response_information = ""
  38. ## The keep alive that EMQX requires the client to use
  39. ## Type:
  40. ## - disabled :: the keep alive specified by the client will be used
  41. ## - Integer :: Keepalive time, only applicable to clients using MQTT 5.0 protocol
  42. server_keepalive = disabled
  43. ## Keep-Alive Timeout = Keep-Alive interval × Keep-Alive Multiplier
  44. keepalive_multiplier = 1.5
  45. ## Maximum number of subscriptions allowed per client
  46. ## Type: infinity | Integer
  47. max_subscriptions = infinity
  48. ## Force upgrade of QoS level according to subscription
  49. upgrade_qos = false
  50. ## Maximum number of QoS 1 and QoS 2 messages that are allowed to be delivered simultaneously before completing the acknowledgment
  51. ## Type: Range from 1 to 65535
  52. max_inflight = 32
  53. ## Retry interval for QoS 1/2 message delivering
  54. retry_interval = 30s
  55. ## For each publisher session, the maximum number of outstanding QoS 2 messages pending on the client to send PUBREL
  56. ## Type: infinity | Integer
  57. max_awaiting_rel = 100
  58. ## For client to broker QoS 2 message, the time limit for the broker to wait before the PUBREL message is received
  59. await_rel_timeout = 300s
  60. ## Specifies how long the session will expire after the connection is disconnected, only for non-MQTT 5.0 connections
  61. session_expiry_interval = 2h
  62. ## The expiry interval of MQTT messages.
  63. ##
  64. ## For MQTT 5.0 clients, this configuration will only take effect when the
  65. ## Message-Expiry-Interval property is not set in the message; otherwise, the
  66. ## value of the Message-Expiry-Interval property will be used.
  67. ## For MQTT versions older than 5.0, this configuration will always take effect.
  68. ## Please note that setting message_expiry_interval greater than session_expiry_interval
  69. ## is meaningless, as all messages will be cleared when the session expires.
  70. ##
  71. ## Type:
  72. ## - infinity :: Never expire
  73. ## - Time Duration :: The expiry interval
  74. ## Default: infinity
  75. message_expiry_interval = infinity
  76. ## Maximum queue length. Enqueued messages when persistent client disconnected, or inflight window is full
  77. ## Type: infinity | Integer
  78. max_mqueue_len = 1000
  79. ## Specifies whether to store QoS 0 messages in the message queue while the connection is down but the session remains
  80. mqueue_store_qos0 = true
  81. ## Whether to user Client ID as Username
  82. use_username_as_clientid = false
  83. ## Use the CN, DN field in the peer certificate or the entire certificate content as Username
  84. ## Type:
  85. ## - disabled
  86. ## - cn :: CN field of the certificate
  87. ## - dn :: DN field of the certificate
  88. ## - crt :: the content of the DER or PEM certificate
  89. ## - pem :: PEM format content converted from DER certificate content
  90. ## - md5 :: the MD5 value of the content of the DER or PEM certificate
  91. peer_cert_as_username = disabled
  92. ## Use the CN, DN field in the peer certificate or the entire certificate content as Client ID
  93. ## Type: See the above
  94. peer_cert_as_clientid = disabled
  95. ## Dispatch strategy for shared subscription
  96. ## Type:
  97. ## - random :: dispatch the message to a random selected subscriber
  98. ## - round_robin :: select the subscribers in a round-robin manner
  99. ## - round_robin_per_group :: select the subscribers in round-robin fashion within each shared subscriber group
  100. ## - local :: select random local subscriber otherwise select random cluster-wide
  101. ## - sticky :: always use the last selected subscriber to dispatch, until the subscriber disconnects.
  102. ## - hash_clientid :: select the subscribers by hashing the `clientIds`
  103. ## - hash_topic :: select the subscribers by hashing the source topic"""
  104. shared_subscription_strategy = round_robin
  105. }