mqtt.conf.example 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. ## Maximum queue length. Enqueued messages when persistent client disconnected, or inflight window is full
  63. ## Type: infinity | Integer
  64. max_mqueue_len = 1000
  65. ## Specifies whether to store QoS 0 messages in the message queue while the connection is down but the session remains
  66. mqueue_store_qos0 = true
  67. ## Whether to user Client ID as Username
  68. use_username_as_clientid = false
  69. ## Use the CN, DN field in the peer certificate or the entire certificate content as Username
  70. ## Type:
  71. ## - disabled
  72. ## - cn :: CN field of the certificate
  73. ## - dn :: DN field of the certificate
  74. ## - crt :: the content of the DER or PEM certificate
  75. ## - pem :: PEM format content converted from DER certificate content
  76. ## - md5 :: the MD5 value of the content of the DER or PEM certificate
  77. peer_cert_as_username = disabled
  78. ## Use the CN, DN field in the peer certificate or the entire certificate content as Client ID
  79. ## Type: See the above
  80. peer_cert_as_clientid = disabled
  81. ## Dispatch strategy for shared subscription
  82. ## Type:
  83. ## - random :: dispatch the message to a random selected subscriber
  84. ## - round_robin :: select the subscribers in a round-robin manner
  85. ## - round_robin_per_group :: select the subscribers in round-robin fashion within each shared subscriber group
  86. ## - local :: select random local subscriber otherwise select random cluster-wide
  87. ## - sticky :: always use the last selected subscriber to dispatch, until the subscriber disconnects.
  88. ## - hash_clientid :: select the subscribers by hashing the `clientIds`
  89. ## - hash_topic :: select the subscribers by hashing the source topic"""
  90. shared_subscription_strategy = round_robin
  91. }