Skip to content

Conversation

@Wei-hao-Li
Copy link
Collaborator

No description provided.

Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
"org.apache.iotdb.externalservice.Mqtt",
// IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService
() -> false),
MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", () -> true),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", () -> true),
MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService),

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the MQTT service from a built-in component of iotdb-server to an external service using the ExternalService framework. This change improves modularity by separating MQTT functionality into its own deployable module.

Changes:

  • Created new external-service-impl/mqtt module with MQTT service implementation
  • Removed MQTT dependencies from iotdb-core/datanode module
  • Updated package structure from org.apache.iotdb.db.protocol.mqtt to org.apache.iotdb.mqtt
  • Added lifecycle management for external services in DataNode
  • Updated build and distribution configurations to package MQTT as a separate jar

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
pom.xml Added external-service-impl module to the reactor build
ServiceType.java Removed MQTT_SERVICE enum value as MQTT is now external
ExternalServiceManagementService.java Enhanced service lifecycle management with directory creation, service restoration, and stop functionality
BuiltinExternalServices.java Updated MQTT and REST service class names for external service framework
DataNode.java Modified initialization to use external service framework and added service cleanup on shutdown
iotdb-core/datanode/pom.xml Removed MQTT-related dependencies (netty-codec-mqtt, moquette-broker)
external-service-impl/pom.xml New parent POM for external service implementations
external-service-impl/mqtt/pom.xml New MQTT module with dependencies and jar-with-dependencies packaging
external-service-impl/mqtt/src/main/java/**/*.java Moved and refactored MQTT implementation classes to new package structure
external-service-impl/mqtt/src/test/java/**/*.java Migrated and cleaned up MQTT test classes
distribution/*.xml Updated assembly descriptors to include MQTT jar in distributions
example/mqtt-customize/** Updated example to reference new MQTT package structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
@Wei-hao-Li Wei-hao-Li changed the title Split mqtt from iotdb-server by using ExternalService framework Decouple mqtt from iotdb-server using ExternalService framework Jan 20, 2026
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.27%. Comparing base (31a07ea) to head (13bad13).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...ernalservice/ExternalServiceManagementService.java 0.00% 27 Missing ⚠️
...ain/java/org/apache/iotdb/db/service/DataNode.java 0.00% 5 Missing ⚠️
...c/main/java/org/apache/iotdb/mqtt/MQTTService.java 0.00% 1 Missing ⚠️
...rvice/externalservice/BuiltinExternalServices.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17042      +/-   ##
============================================
- Coverage     39.29%   39.27%   -0.02%     
- Complexity      212      282      +70     
============================================
  Files          5104     5105       +1     
  Lines        341498   341552      +54     
  Branches      43522    43535      +13     
============================================
- Hits         134181   134161      -20     
- Misses       207317   207391      +74     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

@JackieTien97 JackieTien97 merged commit dce185a into master Jan 20, 2026
34 of 37 checks passed
@JackieTien97 JackieTien97 deleted the splitMqtt branch January 20, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants