## EMQX Configuration for Water Management System ## Cluster cluster.name = water-cluster cluster.discovery_strategy = manual cluster.autoheal = true cluster.proto_dist = inet_tcp ## Listeners ## MQTT/TCP: 1883 listener.tcp.1883 = 0.0.0.0:1883 listener.tcp.1883.enable = true ## MQTT/SSL: 8883 (disabled) listener.ssl.8883 = 0.0.0.0:8883 ## WebSocket: 8081 listener.ws.8081 = 0.0.0.0:8081 listener.ws.8081.enable = true ## WSS: 8084 (disabled) listener.wss.8084 = 0.0.0.0:8084 ## HTTP: 8083 listener.http.8083 = 0.0.0.0:8083 ## Dashboard dashboard { listeners.http.18083 = 0.0.0.0:18083 listeners.http.18083.enable = true default_username = admin default_password = public } ## Authentication (disabled for development) auth { no_match = allow cache.enable = false } ## Authorization (disabled for development) acl { file = etc/acl.conf nomatch = allow } ## MQTT Rules for message routing rule { # Rule for raw telemetry data for topic "water/iot/+/+/raw" do republish("iot.raw.${2}", "${payload}") to mqtt Broker # Rule for processed telemetry data for topic "water/iot/+/+/telemetry" do republish("iot.telemetry", "${payload}") to mqtt Broker # Rule for device commands for topic "water/iot/command/+/+/+" do republish("iot.command", "${payload}") to mqtt Broker # Rule for device events for topic "water/iot/+/+/event" do republish("iot.event", "${payload}") to mqtt Broker } ## Logging log { level = info file = logs/emqx.log rotation { size = 10MB count = 5 } } ## Metrics metrics { enable = true interval = 30 } ## Plugins plugins { enable_file_config = true startup_file = data/startupscripts shutdown_file = data/shutdownscripts } ## MQTT Keepalive mqtt { keepalive_backoff = 0.75 keepalive_multiplier = 1.5 clientinfo_force_update = true } ## Sessions sessions { expiry_interval = 0 max_packet_size = 1MB max_inflight = 32 max_queue_len = 1000 }