智慧水务管理系统 - 精河县供水工程综合管理平台

emqx.conf 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. ## EMQX Configuration for Water Management System
  2. ## Cluster
  3. cluster.name = water-cluster
  4. cluster.discovery_strategy = manual
  5. cluster.autoheal = true
  6. cluster.proto_dist = inet_tcp
  7. ## Listeners
  8. ## MQTT/TCP: 1883
  9. listener.tcp.1883 = 0.0.0.0:1883
  10. listener.tcp.1883.enable = true
  11. ## MQTT/SSL: 8883 (disabled)
  12. listener.ssl.8883 = 0.0.0.0:8883
  13. ## WebSocket: 8081
  14. listener.ws.8081 = 0.0.0.0:8081
  15. listener.ws.8081.enable = true
  16. ## WSS: 8084 (disabled)
  17. listener.wss.8084 = 0.0.0.0:8084
  18. ## HTTP: 8083
  19. listener.http.8083 = 0.0.0.0:8083
  20. ## Dashboard
  21. dashboard {
  22. listeners.http.18083 = 0.0.0.0:18083
  23. listeners.http.18083.enable = true
  24. default_username = admin
  25. default_password = public
  26. }
  27. ## Authentication (disabled for development)
  28. auth {
  29. no_match = allow
  30. cache.enable = false
  31. }
  32. ## Authorization (disabled for development)
  33. acl {
  34. file = etc/acl.conf
  35. nomatch = allow
  36. }
  37. ## MQTT Rules for message routing
  38. rule {
  39. # Rule for raw telemetry data
  40. for topic "water/iot/+/+/raw" do
  41. republish("iot.raw.${2}", "${payload}")
  42. to mqtt Broker
  43. # Rule for processed telemetry data
  44. for topic "water/iot/+/+/telemetry" do
  45. republish("iot.telemetry", "${payload}")
  46. to mqtt Broker
  47. # Rule for device commands
  48. for topic "water/iot/command/+/+/+" do
  49. republish("iot.command", "${payload}")
  50. to mqtt Broker
  51. # Rule for device events
  52. for topic "water/iot/+/+/event" do
  53. republish("iot.event", "${payload}")
  54. to mqtt Broker
  55. }
  56. ## Logging
  57. log {
  58. level = info
  59. file = logs/emqx.log
  60. rotation {
  61. size = 10MB
  62. count = 5
  63. }
  64. }
  65. ## Metrics
  66. metrics {
  67. enable = true
  68. interval = 30
  69. }
  70. ## Plugins
  71. plugins {
  72. enable_file_config = true
  73. startup_file = data/startupscripts
  74. shutdown_file = data/shutdownscripts
  75. }
  76. ## MQTT Keepalive
  77. mqtt {
  78. keepalive_backoff = 0.75
  79. keepalive_multiplier = 1.5
  80. clientinfo_force_update = true
  81. }
  82. ## Sessions
  83. sessions {
  84. expiry_interval = 0
  85. max_packet_size = 1MB
  86. max_inflight = 32
  87. max_queue_len = 1000
  88. }