Merge pull request #195 from ni-ze/Ibuilder
[ISSUE #196]fix(ChannelBuilder) add ChannelBuilder
diff --git a/rocketmq-streams-channel-mqtt/pom.xml b/rocketmq-streams-channel-mqtt/pom.xml
index 637f656..40ed60c 100644
--- a/rocketmq-streams-channel-mqtt/pom.xml
+++ b/rocketmq-streams-channel-mqtt/pom.xml
@@ -22,10 +22,6 @@
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-streams-commons</artifactId>
</dependency>
- <!-- <dependency>-->
- <!-- <groupId>com.hivemq</groupId>-->
- <!-- <artifactId>hivemq-mqtt-client</artifactId>-->
- <!-- </dependency>-->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
diff --git a/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSinkBuilder.java b/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSinkBuilder.java
index f2d67a0..1772fe0 100644
--- a/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSinkBuilder.java
+++ b/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSinkBuilder.java
@@ -31,7 +31,7 @@
@ServiceName(value = CollectionSinkBuilder.TYPE)
public class CollectionSinkBuilder implements IChannelBuilder {
- public static final String TYPE = "collection";
+ public static final String TYPE = "CollectionSink";
@Override
public ISource createSource(String namespace, String name, Properties properties, MetaData metaData) {
diff --git a/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSourceBuilder.java b/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSourceBuilder.java
new file mode 100644
index 0000000..7cfe4ac
--- /dev/null
+++ b/rocketmq-streams-commons/src/main/java/org/apache/rocketmq/streams/common/channel/impl/CollectionSourceBuilder.java
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+package org.apache.rocketmq.streams.common.channel.impl;
+
+import com.google.auto.service.AutoService;
+import org.apache.rocketmq.streams.common.channel.builder.AbstractSupportShuffleChannelBuilder;
+import org.apache.rocketmq.streams.common.channel.builder.IChannelBuilder;
+import org.apache.rocketmq.streams.common.channel.impl.memory.MemoryChannel;
+import org.apache.rocketmq.streams.common.channel.sink.ISink;
+import org.apache.rocketmq.streams.common.channel.source.ISource;
+import org.apache.rocketmq.streams.common.metadata.MetaData;
+import org.apache.rocketmq.streams.common.model.ServiceName;
+
+import java.util.Properties;
+
+/*
+ * 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.
+ */
+
+@AutoService(IChannelBuilder.class)
+@ServiceName(value = CollectionSourceBuilder.TYPE)
+public class CollectionSourceBuilder extends AbstractSupportShuffleChannelBuilder {
+ public static final String TYPE = "CollectionSource";
+
+ @Override
+ public ISource<?> createSource(String namespace, String name, Properties properties, MetaData metaData) {
+ return new MemoryChannel();
+ }
+
+ @Override
+ public String getType() {
+ return TYPE;
+ }
+
+ @Override
+ public ISink<?> createSink(String namespace, String name, Properties properties, MetaData metaData) {
+ return new MemoryChannel();
+ }
+
+ @Override
+ public ISink<?> createBySource(ISource<?> pipelineSource) {
+ return new MemoryChannel();
+ }
+}
diff --git a/rocketmq-streams-serviceloader/pom.xml b/rocketmq-streams-serviceloader/pom.xml
index eec6092..f8a482f 100755
--- a/rocketmq-streams-serviceloader/pom.xml
+++ b/rocketmq-streams-serviceloader/pom.xml
@@ -29,7 +29,6 @@
<name>ROCKETMQ STREAMS :: serviceloader</name>
<dependencies>
- <!-- 测试依赖 -->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-streams-commons</artifactId>