You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Wei-hao-Li (via GitHub)" <gi...@apache.org> on 2026/01/19 11:22:46 UTC

[PR] Split mqtt from iotdb-server by using ExternalService framework [iotdb]

Wei-hao-Li opened a new pull request, #17042:
URL: https://github.com/apache/iotdb/pull/17042

   (no comment)


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Split mqtt from iotdb-server by using ExternalService framework [iotdb]

Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou commented on code in PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#discussion_r2706526218


##########
external-service-impl/pom.xml:
##########
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>2.0.7-SNAPSHOT</version>
+    </parent>
+    <artifactId>external-service-impl</artifactId>
+    <name>IoTDB: External-Service-Impl</name>
+    <packaging>pom</packaging>
+    <modules>
+        <module>mqtt</module>
+    </modules>
+    <properties>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>

Review Comment:
   Should be 8?



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Split mqtt from iotdb-server by using ExternalService framework [iotdb]

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 commented on code in PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#discussion_r2704371358


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/BuiltinExternalServices.java:
##########
@@ -22,14 +22,10 @@
 import java.util.function.Supplier;
 
 public enum BuiltinExternalServices {
-  MQTT(
-      "MQTT",
-      "org.apache.iotdb.externalservice.Mqtt",
-      // IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService
-      () -> false),
+  MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", () -> true),

Review Comment:
   ```suggestion
     MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService),
   ```



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Decouple mqtt from iotdb-server using ExternalService framework [iotdb]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#issuecomment-3771124718

   ## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/17042?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `34 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 39.28%. Comparing base ([`31a07ea`](https://app.codecov.io/gh/apache/iotdb/commit/31a07eaeb601d5b6ca4d21c0906d47af2b479f6e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`04904b1`](https://app.codecov.io/gh/apache/iotdb/commit/04904b16b3ca5a7739fc80f13bac0f3aeb032580?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/17042?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ernalservice/ExternalServiceManagementService.java](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fservice%2Fexternalservice%2FExternalServiceManagementService.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvc2VydmljZS9leHRlcm5hbHNlcnZpY2UvRXh0ZXJuYWxTZXJ2aWNlTWFuYWdlbWVudFNlcnZpY2UuamF2YQ==) | 0.00% | [27 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ain/java/org/apache/iotdb/db/service/DataNode.java](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fservice%2FDataNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvc2VydmljZS9EYXRhTm9kZS5qYXZh) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...c/main/java/org/apache/iotdb/mqtt/MQTTService.java](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&filepath=external-service-impl%2Fmqtt%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fmqtt%2FMQTTService.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZXJuYWwtc2VydmljZS1pbXBsL21xdHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2lvdGRiL21xdHQvTVFUVFNlcnZpY2UuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...rvice/externalservice/BuiltinExternalServices.java](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fservice%2Fexternalservice%2FBuiltinExternalServices.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvc2VydmljZS9leHRlcm5hbHNlcnZpY2UvQnVpbHRpbkV4dGVybmFsU2VydmljZXMuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #17042      +/-   ##
   ============================================
   - Coverage     39.29%   39.28%   -0.01%     
   - Complexity      212      282      +70     
   ============================================
     Files          5104     5104              
     Lines        341498   341519      +21     
     Branches      43522    43526       +4     
   ============================================
   - Hits         134181   134167      -14     
   - Misses       207317   207352      +35     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/iotdb/pull/17042?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Decouple mqtt from iotdb-server using ExternalService framework [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#issuecomment-3771861193

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17042) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=17042&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17042)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Split mqtt from iotdb-server by using ExternalService framework [iotdb]

Posted by "Wei-hao-Li (via GitHub)" <gi...@apache.org>.
Wei-hao-Li commented on code in PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#discussion_r2706604943


##########
external-service-impl/pom.xml:
##########
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>2.0.7-SNAPSHOT</version>
+    </parent>
+    <artifactId>external-service-impl</artifactId>
+    <name>IoTDB: External-Service-Impl</name>
+    <packaging>pom</packaging>
+    <modules>
+        <module>mqtt</module>
+    </modules>
+    <properties>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>

Review Comment:
   > Should be 8?
   
   Yes, i will change it.



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Decouple mqtt from iotdb-server using ExternalService framework [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#issuecomment-3771231573

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17042) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=17042&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17042)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Split mqtt from iotdb-server by using ExternalService framework [iotdb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #17042:
URL: https://github.com/apache/iotdb/pull/17042#discussion_r2704396592


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/ExternalServiceManagementService.java:
##########
@@ -170,7 +186,8 @@ public void startService(String serviceName) throws ClientManagerException, TExc
 
   private IExternalService createExternalServiceInstance(String serviceName, String className) {
     // close ClassLoader automatically to release the file handle
-    try (ExternalServiceClassLoader classLoader = new ExternalServiceClassLoader(libRoot); ) {
+    try {
+      ExternalServiceClassLoader classLoader = new ExternalServiceClassLoader(libRoot);

Review Comment:
   The ClassLoader is no longer being closed, which could lead to a resource leak. The original code used try-with-resources to automatically close the ExternalServiceClassLoader. Removing this will prevent the file handles from being released properly. Consider either reverting to try-with-resources or explicitly closing the classLoader in a finally block.
   ```suggestion
       try (ExternalServiceClassLoader classLoader = new ExternalServiceClassLoader(libRoot)) {
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/ExternalServiceManagementService.java:
##########
@@ -65,10 +66,25 @@ public class ExternalServiceManagementService {
   private static final Logger LOGGER =
       LoggerFactory.getLogger(ExternalServiceManagementService.class);
 
+  public static final String INSTANCE_NULL_ERROR_MSG =
+      "External Service instance is null when state is RUNNING!";
+
   private ExternalServiceManagementService(String libRoot) {
     this.serviceInfos = new HashMap<>();
     restoreBuiltInServices();
     this.libRoot = libRoot;
+    makDir(libRoot);
+  }
+
+  private static void makDir(String dir) {

Review Comment:
   The method name 'makDir' is misspelled. It should be 'makeDir' or 'mkDir' to follow standard naming conventions.
   ```suggestion
       makeDir(libRoot);
     }
   
     private static void makeDir(String dir) {
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/BuiltinExternalServices.java:
##########
@@ -22,14 +22,10 @@
 import java.util.function.Supplier;
 
 public enum BuiltinExternalServices {
-  MQTT(
-      "MQTT",
-      "org.apache.iotdb.externalservice.Mqtt",
-      // IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService
-      () -> false),
+  MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", () -> true),

Review Comment:
   The MQTT service is now hardcoded to always be enabled (supplier returns true), ignoring the previous configuration check for isEnableMQTTService. This changes the behavior from the commented-out line and may cause the MQTT service to start even when users have it disabled in their configuration. The configuration check should be restored or this change should be documented as an intentional behavior change.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/ExternalServiceManagementService.java:
##########
@@ -311,11 +328,34 @@ public void restoreRunningServiceInstance() {
             serviceInfo -> {
               // start services with RUNNING state
               if (serviceInfo.getState() == RUNNING) {
-                IExternalService serviceInstance =
-                    createExternalServiceInstance(
-                        serviceInfo.getServiceName(), serviceInfo.getClassName());
-                serviceInfo.setServiceInstance(serviceInstance);
-                serviceInstance.start();
+
+                try {
+                  IExternalService serviceInstance =
+                      createExternalServiceInstance(
+                          serviceInfo.getServiceName(), serviceInfo.getClassName());
+                  serviceInfo.setServiceInstance(serviceInstance);
+                } finally {
+                  // set STOPPED to avoid the case: service is RUNNING, but its instance is null
+                  if (serviceInfo.getServiceInstance() == null) {
+                    serviceInfo.setState(STOPPED);
+                  }
+                }
+
+                serviceInfo.getServiceInstance().start();

Review Comment:
   There's a logic issue where serviceInstance.start() is called outside the try-finally block. If serviceInfo.getServiceInstance() is null (which is explicitly handled in the finally block by setting state to STOPPED), this will throw a NullPointerException when trying to call start() on line 344. The start() call should be inside the try block or checked for null before calling.
   ```suggestion
                     if (serviceInstance != null) {
                       serviceInstance.start();
                     }
                   } finally {
                     // set STOPPED to avoid the case: service is RUNNING, but its instance is null
                     if (serviceInfo.getServiceInstance() == null) {
                       serviceInfo.setState(STOPPED);
                     }
                   }
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/ExternalServiceManagementService.java:
##########
@@ -311,11 +328,34 @@ public void restoreRunningServiceInstance() {
             serviceInfo -> {
               // start services with RUNNING state
               if (serviceInfo.getState() == RUNNING) {
-                IExternalService serviceInstance =
-                    createExternalServiceInstance(
-                        serviceInfo.getServiceName(), serviceInfo.getClassName());
-                serviceInfo.setServiceInstance(serviceInstance);
-                serviceInstance.start();
+
+                try {
+                  IExternalService serviceInstance =
+                      createExternalServiceInstance(
+                          serviceInfo.getServiceName(), serviceInfo.getClassName());
+                  serviceInfo.setServiceInstance(serviceInstance);
+                } finally {
+                  // set STOPPED to avoid the case: service is RUNNING, but its instance is null
+                  if (serviceInfo.getServiceInstance() == null) {
+                    serviceInfo.setState(STOPPED);
+                  }
+                }
+
+                serviceInfo.getServiceInstance().start();
+              }
+            });
+  }
+
+  public void stopRunningServices() {
+    serviceInfos
+        .values()
+        .forEach(
+            serviceInfo -> {
+              // start services with RUNNING state

Review Comment:
   The comment says 'start services with RUNNING state' but the method actually stops services. This should be 'stop services with RUNNING state' to accurately describe what the code does.
   ```suggestion
                 // stop services with RUNNING state
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/ExternalServiceManagementService.java:
##########
@@ -65,10 +66,25 @@ public class ExternalServiceManagementService {
   private static final Logger LOGGER =
       LoggerFactory.getLogger(ExternalServiceManagementService.class);
 
+  public static final String INSTANCE_NULL_ERROR_MSG =
+      "External Service instance is null when state is RUNNING!";
+
   private ExternalServiceManagementService(String libRoot) {
     this.serviceInfos = new HashMap<>();
     restoreBuiltInServices();
     this.libRoot = libRoot;
+    makDir(libRoot);
+  }
+
+  private static void makDir(String dir) {

Review Comment:
   The method name 'makDir' is misspelled. It should be 'makeDir' or 'mkDir' to follow standard naming conventions.
   ```suggestion
       makeDir(libRoot);
     }
   
     private static void makeDir(String dir) {
   ```



##########
external-service-impl/mqtt/pom.xml:
##########
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>external-service-impl</artifactId>
+        <version>2.0.7-SNAPSHOT</version>
+    </parent>
+    <artifactId>mqtt</artifactId>
+    <name>IoTDB: External-Service-Impl: MQTT</name>
+    <properties>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>com.github.moquette-io.moquette</groupId>
+            <artifactId>moquette-broker</artifactId>
+            <exclusions>
+                <!-- exclude dependencies has included by iotdb-server -->

Review Comment:
   Grammar issue in the comment: 'dependencies has included' should be 'dependencies already included' or 'dependencies that have been included'.
   ```suggestion
                   <!-- exclude dependencies already included by iotdb-server -->
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/externalservice/BuiltinExternalServices.java:
##########
@@ -22,14 +22,10 @@
 import java.util.function.Supplier;
 
 public enum BuiltinExternalServices {
-  MQTT(
-      "MQTT",
-      "org.apache.iotdb.externalservice.Mqtt",
-      // IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService
-      () -> false),
+  MQTT("MQTT", "org.apache.iotdb.mqtt.MQTTService", () -> true),
   REST(
       "REST",
-      "org.apache.iotdb.externalservice.Rest",
+      "org.apache.iotdb.mqtt.RestService",

Review Comment:
   The REST service class name 'org.apache.iotdb.mqtt.RestService' appears to be incorrectly placed in the mqtt package. REST service should have its own package structure, not be part of the MQTT package. This is misleading and violates package organization principles.
   ```suggestion
         "org.apache.iotdb.rest.RestService",
   ```



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Decouple mqtt from iotdb-server using ExternalService framework [iotdb]

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #17042:
URL: https://github.com/apache/iotdb/pull/17042


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org