Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@
<artifactId>spark-iotdb-connector_2.12</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>sparkplugb-connector</artifactId>
<version>${project.version}</version>
<classifier>jar-with-dependencies</classifier>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down
1 change: 1 addition & 0 deletions distribution/src/assembly/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@
<!-- </files>-->
<componentDescriptors>
<componentDescriptor>common-files.xml</componentDescriptor>
<componentDescriptor>sparkplugb-connector.xml</componentDescriptor>
</componentDescriptors>
</assembly>
32 changes: 32 additions & 0 deletions distribution/src/assembly/sparkplugb-connector.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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.

-->
<component xmlns="http://maven.apache.org/ASSEMBLY-COMPONENT/2.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY-COMPONENT/2.1.0 http://maven.apache.org/xsd/assembly-component-2.1.0.xsd">
<dependencySets>
<dependencySet>
<includes>
<include>*:sparkplugb-connector:jar:jar-with-dependencies:*</include>
</includes>
<outputDirectory>${file.separator}ext${file.separator}mqtt</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}-${artifact.classifier}.${artifact.extension}</outputFileNameMapping>
</dependencySet>
</dependencySets>
</component>
1 change: 1 addition & 0 deletions iotdb-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<module>hive-connector</module>
<module>spark-iotdb-connector</module>
<module>spark-tsfile</module>
<module>sparkplugb-connector</module>
<module>zeppelin-interpreter</module>
</modules>
<profiles>
Expand Down
58 changes: 58 additions & 0 deletions iotdb-connector/sparkplugb-connector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--

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.

-->

# Sparkplug B 1.0 Connector

## Installing the plugin

In the Apache IoTDB directory, create a directory `ext/mqtt`.

Copy the `jar` of thit plugin into this directory.

Edit the `conf/iotdb-common.properties` file to contain the following configuration:

####################
### MQTT Broker Configuration
####################

# whether to enable the mqtt service.
# Datatype: boolean
enable_mqtt_service=true

# the mqtt service binding host.
# Datatype: String
mqtt_host=127.0.0.1

# the mqtt service binding port.
# Datatype: int
mqtt_port=1883

# the handler pool size for handing the mqtt messages.
# Datatype: int
mqtt_handler_pool_size=1

# the mqtt message payload formatter.
# Datatype: String
mqtt_payload_formatter=spB1.0

# max length of mqtt message in byte
# Datatype: int
mqtt_max_message_size=1048576
127 changes: 127 additions & 0 deletions iotdb-connector/sparkplugb-connector/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?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-connector</artifactId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<artifactId>sparkplugb-connector</artifactId>
<name>IoTDB: Connector: SparkplugB</name>
<properties>
<proto.version>3.24.2</proto.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<!--
Get additional stuff we need for the build.
-->
<execution>
<id>get-unity</id>
<phase>generate-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/eclipse/tahu/master/sparkplug_b/sparkplug_b.proto</url>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>3.11.4</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<addProtoSources>all</addProtoSources>
<includeMavenTypes>direct</includeMavenTypes>
<protocVersion>${proto.version}</protocVersion>
<inputDirectories>
<include>${project.build.directory}/dependency</include>
</inputDirectories>
</configuration>
</execution>
</executions>
</plugin>
<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>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
<configuration>
<filters>
<filter/>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>tsfile</artifactId>
<version>1.3.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-server</artifactId>
<version>1.3.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${proto.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>
</dependencies>
</project>
Loading