This is an automated email from the ASF dual-hosted git repository.
weihao pushed a commit to branch splitMqtt
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/splitMqtt by this push:
new 5a883106e81 draft
5a883106e81 is described below
commit 5a883106e8195b944c5b462142b905d9d6bd652e
Author: Weihao Li <[email protected]>
AuthorDate: Mon Jan 19 15:46:05 2026 +0800
draft
Signed-off-by: Weihao Li <[email protected]>
---
distribution/pom.xml | 7 ++
distribution/src/assembly/datanode.xml | 1 -
.../src/assembly/external-service-impl.xml | 60 +++++++++++
example/mqtt-customize/pom.xml | 3 +-
.../server/CustomizedJsonPayloadFormatter.java | 6 +-
example/pom.xml | 2 +-
external-service-impl/mqtt/pom.xml | 117 +++++++++++----------
.../mqtt/src/assembly/external-service-impl.xml | 30 +++---
.../org.apache.iotdb.mqtt.PayloadFormatter | 0
external-service-impl/pom.xml | 7 +-
iotdb-core/datanode/pom.xml | 8 --
11 files changed, 146 insertions(+), 95 deletions(-)
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 38c4602d113..8b13a815a5a 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -53,6 +53,11 @@
<artifactId>library-udf</artifactId>
<version>2.0.7-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iotdb</groupId>
+ <artifactId>mqtt</artifactId>
+ <version>2.0.7-SNAPSHOT</version>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -74,6 +79,7 @@
<descriptor>src/assembly/confignode.xml</descriptor>
<descriptor>src/assembly/cli.xml</descriptor>
<descriptor>src/assembly/library-udf.xml</descriptor>
+
<descriptor>src/assembly/external-service-impl.xml</descriptor>
</descriptors>
<finalName>apache-iotdb-${project.version}</finalName>
</configuration>
@@ -107,6 +113,7 @@
<include>apache-iotdb-${project.version}-cli-bin.zip</include>
<include>apache-iotdb-${project.version}-confignode-bin.zip</include>
<include>apache-iotdb-${project.version}-library-udf-bin.zip</include>
+
<include>apache-iotdb-${project.version}-external-service-impl-bin.zip</include>
</includes>
</fileSet>
</fileSets>
diff --git a/distribution/src/assembly/datanode.xml
b/distribution/src/assembly/datanode.xml
index 5393568e4cf..016059a903a 100644
--- a/distribution/src/assembly/datanode.xml
+++ b/distribution/src/assembly/datanode.xml
@@ -31,7 +31,6 @@
<includes>
<include>*:iotdb-server:zip:*</include>
<include>*:iotdb-cli:zip:*</include>
- <include>*:external-service-impl</include>
</includes>
<outputDirectory>${file.separator}</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
diff --git a/distribution/src/assembly/external-service-impl.xml
b/distribution/src/assembly/external-service-impl.xml
new file mode 100644
index 00000000000..b5a46fbb7cc
--- /dev/null
+++ b/distribution/src/assembly/external-service-impl.xml
@@ -0,0 +1,60 @@
+<?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.
+
+-->
+<assembly>
+ <id>external-service-impl-bin</id>
+ <formats>
+ <format>dir</format>
+ <format>zip</format>
+ </formats>
+
<baseDirectory>apache-iotdb-${project.version}-external-service-impl-bin</baseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>org.apache.iotdb:mqtt</include>
+ </includes>
+ <outputDirectory/>
+
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+ <unpack>false</unpack>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}/../licenses</directory>
+ <outputDirectory>licenses</outputDirectory>
+ </fileSet>
+ </fileSets>
+ <files>
+ <file>
+ <source>${project.basedir}/../LICENSE-binary</source>
+ <outputDirectory>licenses</outputDirectory>
+ <destName>LICENSE</destName>
+ </file>
+ <file>
+ <source>${project.basedir}/../NOTICE-binary</source>
+ <outputDirectory>licenses</outputDirectory>
+ <destName>NOTICE</destName>
+ </file>
+ </files>
+</assembly>
diff --git a/example/mqtt-customize/pom.xml b/example/mqtt-customize/pom.xml
index c6857480264..5af64dd9fc5 100644
--- a/example/mqtt-customize/pom.xml
+++ b/example/mqtt-customize/pom.xml
@@ -29,10 +29,9 @@
<artifactId>customize-mqtt-example</artifactId>
<name>IoTDB: Example: Customized MQTT</name>
<dependencies>
- <!-- used by the server-->
<dependency>
<groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-mqtt</artifactId>
+ <artifactId>mqtt</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
diff --git
a/example/mqtt-customize/src/main/java/org/apache/iotdb/mqtt/server/CustomizedJsonPayloadFormatter.java
b/example/mqtt-customize/src/main/java/org/apache/iotdb/mqtt/server/CustomizedJsonPayloadFormatter.java
index 8c3a9621739..b16c4928a0b 100644
---
a/example/mqtt-customize/src/main/java/org/apache/iotdb/mqtt/server/CustomizedJsonPayloadFormatter.java
+++
b/example/mqtt-customize/src/main/java/org/apache/iotdb/mqtt/server/CustomizedJsonPayloadFormatter.java
@@ -19,9 +19,9 @@
package org.apache.iotdb.mqtt.server;
-import org.apache.iotdb.db.protocol.mqtt.Message;
-import org.apache.iotdb.db.protocol.mqtt.PayloadFormatter;
-import org.apache.iotdb.db.protocol.mqtt.TreeMessage;
+import org.apache.iotdb.mqtt.Message;
+import org.apache.iotdb.mqtt.PayloadFormatter;
+import org.apache.iotdb.mqtt.TreeMessage;
import io.netty.buffer.ByteBuf;
import org.apache.tsfile.external.commons.lang3.NotImplementedException;
diff --git a/example/pom.xml b/example/pom.xml
index 5b6bac69a0e..9af648e0d26 100644
--- a/example/pom.xml
+++ b/example/pom.xml
@@ -32,7 +32,7 @@
<modules>
<module>jdbc</module>
<module>mqtt</module>
- <!-- //TODO -->
+ <module>mqtt-customize</module>
<module>pipe-count-point-processor</module>
<module>pipe-opc-ua-sink</module>
<module>rest-java-example</module>
diff --git a/external-service-impl/mqtt/pom.xml
b/external-service-impl/mqtt/pom.xml
index 3e08d1e7ff0..510e7cf8bbf 100644
--- a/external-service-impl/mqtt/pom.xml
+++ b/external-service-impl/mqtt/pom.xml
@@ -27,6 +27,7 @@
<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>
@@ -36,37 +37,46 @@
<dependency>
<groupId>com.github.moquette-io.moquette</groupId>
<artifactId>moquette-broker</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-thrift-commons</artifactId>
- <version>2.0.7-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tsfile</groupId>
- <artifactId>tsfile</artifactId>
- <version>${tsfile.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-thrift</artifactId>
- <version>2.0.7-SNAPSHOT</version>
+ <exclusions>
+ <!-- exclude dependencies has included by iotdb-server -->
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-resolver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport-native-unix-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec-http</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.iotdb</groupId>
- <artifactId>node-commons</artifactId>
+ <artifactId>iotdb-server</artifactId>
+ <scope>provided</scope>
<version>2.0.7-SNAPSHOT</version>
</dependency>
<dependency>
@@ -83,33 +93,26 @@
<artifactId>netty-codec-mqtt</artifactId>
</dependency>
</dependencies>
- <profiles>
- <profile>
- <id>get-jar-with-dependencies</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptorRefs>
-
<descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/example/mqtt-customize/pom.xml
b/external-service-impl/mqtt/src/assembly/external-service-impl.xml
similarity index 52%
copy from example/mqtt-customize/pom.xml
copy to external-service-impl/mqtt/src/assembly/external-service-impl.xml
index c6857480264..735e6ed0d7f 100644
--- a/example/mqtt-customize/pom.xml
+++ b/external-service-impl/mqtt/src/assembly/external-service-impl.xml
@@ -19,21 +19,15 @@
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-examples</artifactId>
- <version>2.0.7-SNAPSHOT</version>
- </parent>
- <artifactId>customize-mqtt-example</artifactId>
- <name>IoTDB: Example: Customized MQTT</name>
- <dependencies>
- <!-- used by the server-->
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-mqtt</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
+<assembly>
+ <id>jar-with-dependencies</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ </dependencySet>
+ </dependencySets>
+</assembly>
diff --git
a/external-service-impl/mqtt/src/main/resources/META-INF.services/org.apache.iotdb.mqtt.PayloadFormatter
b/external-service-impl/mqtt/src/main/resources/META-INF/services/org.apache.iotdb.mqtt.PayloadFormatter
similarity index 100%
rename from
external-service-impl/mqtt/src/main/resources/META-INF.services/org.apache.iotdb.mqtt.PayloadFormatter
rename to
external-service-impl/mqtt/src/main/resources/META-INF/services/org.apache.iotdb.mqtt.PayloadFormatter
diff --git a/external-service-impl/pom.xml b/external-service-impl/pom.xml
index 2eeaec2c014..b2191a28d0d 100644
--- a/external-service-impl/pom.xml
+++ b/external-service-impl/pom.xml
@@ -27,6 +27,7 @@
<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>
@@ -40,11 +41,7 @@
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>external-service-api</artifactId>
- <version>2.0.7-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-server</artifactId>
+ <scope>provided</scope>
<version>2.0.7-SNAPSHOT</version>
</dependency>
<dependency>
diff --git a/iotdb-core/datanode/pom.xml b/iotdb-core/datanode/pom.xml
index af2c714b0ea..b55fd8e5c68 100644
--- a/iotdb-core/datanode/pom.xml
+++ b/iotdb-core/datanode/pom.xml
@@ -212,10 +212,6 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
</dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-codec-mqtt</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
@@ -271,10 +267,6 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- </dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>