HeartLinked opened a new pull request, #314: URL: https://github.com/apache/rocketmq-mqtt/pull/314
This PR introduces a new "Standalone Mode" for RocketMQ-MQTT. The primary motivation is to simplify deployment and reduce operational overhead for users who do not require the high-availability and advanced features (like Retain and Will messages) provided by the meta module.By disabling the meta service dependency, users can run a single MQTT node with a much simpler configuration. ### Key Changes This feature is implemented through a series of coordinated changes across the common, ds, and cs modules: 1. New Configuration Options: + enableMetaModule (in service.conf): A boolean switch (true by default) to enable or disable the entire meta module and its dependent features. + staticFirstTopics (in service.conf): A comma-separated list of topics, required when enableMetaModule is false. + localAddress (in service.conf): The address for internal RPC loopback, required when enableMetaModule is false. 2. Conditional Logic in NotifyManager: The NotifyManager has been refactored to operate in two modes.When meta is disabled, it subscribes to the topics listed in staticFirstTopics at startup, instead of dynamically refreshing from the meta service. The message notification logic (notifyMessage) is adjusted to perform a local RPC loopback to itself, instead of broadcasting to a cluster of nodes. 3. Feature Gates for will and retain Messages: To ensure system stability, features dependent on the meta module are now gated by the enableMetaModule switch. + Will Messages: The MqttConnectHandler now checks the switch. If a client attempts to set a Will Message while the meta module is disabled, the server will log an error and close the connection. + Retain Messages: The PublishProcessor now checks the switch. If a client attempts to publish a message with the retain flag set while the meta module is disabled, the request is actively rejected. ### How to Configure and Test Standalone Mode + In service.conf, set enableMetaModule=false. + Configure staticFirstTopics with a comma-separated list of all your application's first-level topics (e.g., staticFirstTopics=topicA,iot/devices). + Configure localAddress (e.g., localAddress=127.0.0.1). + Start the service using only sh mqtt.sh start. The meta.sh process is not needed. + To Test Rejection: Connect a client with a Will Message set. The server should refuse the connection. With an active connection, publish a message with the retain flag set to true. The server should close the connection. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org