You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2025/02/07 04:32:07 UTC
(eventmesh) 07/27: [ISSUE #4935] Add and Move the Pojo Used By Both Runtime and Admin to Common
This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch eventmesh-function
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
commit 1a870020a117e9ac78889eef261a35dfb0c3a763
Author: sodaRyCN <35...@users.noreply.github.com>
AuthorDate: Wed May 29 11:01:42 2024 +0800
[ISSUE #4935] Add and Move the Pojo Used By Both Runtime and Admin to Common
---
.../org/apache/eventmesh/common/Constants.java | 2 +
.../common/config/CommonConfiguration.java | 3 +
.../eventmesh/common/config/ConfigService.java | 11 +-
.../eventmesh/common/config/connector/Config.java | 21 ++
.../common/config/connector/Constants.java | 33 +++
.../common/config/connector/PubSubConfig.java | 41 ++++
.../common/config/connector/SinkConfig.java | 31 +++
.../common/config/connector/SourceConfig.java | 33 +++
.../connector/dingtalk/DingDingSinkConfig.java | 30 +++
.../connector/dingtalk/SinkConnectorConfig.java | 36 +++
.../config/connector/file/FileSinkConfig.java | 35 +++
.../config/connector/file/FileSourceConfig.java | 30 +++
.../config/connector/file/SinkConnectorConfig.java | 28 +++
.../connector/file/SourceConnectorConfig.java | 28 +++
.../config/connector/http/HttpSourceConfig.java | 30 +++
.../connector/http/SourceConnectorConfig.java | 32 +++
.../connector/knative/KnativeSinkConfig.java | 31 +++
.../connector/knative/KnativeSourceConfig.java | 31 +++
.../connector/knative/SinkConnectorConfig.java | 31 +++
.../connector/knative/SourceConnectorConfig.java | 31 +++
.../config/connector/lark/LarkSinkConfig.java | 31 +++
.../config/connector/lark/SinkConnectorConfig.java | 57 +++++
.../config/connector/mq/kafka/KafkaSinkConfig.java | 29 +++
.../connector/mq/kafka/KafkaSourceConfig.java | 28 +++
.../connector/mq/kafka/SinkConnectorConfig.java | 39 ++++
.../connector/mq/kafka/SourceConnectorConfig.java | 36 +++
.../connector/mq/pulsar/PulsarSinkConfig.java | 29 +++
.../connector/mq/pulsar/PulsarSourceConfig.java | 28 +++
.../connector/mq/pulsar/SinkConnectorConfig.java | 30 +++
.../connector/mq/pulsar/SourceConnectorConfig.java | 30 +++
.../connector/mq/rabbitmq/RabbitMQSinkConfig.java | 31 +++
.../mq/rabbitmq/RabbitMQSourceConfig.java | 30 +++
.../connector/mq/rabbitmq/SinkConnectorConfig.java | 46 ++++
.../mq/rabbitmq/SourceConnectorConfig.java | 46 ++++
.../connector/mq/rocketmq/RocketMQSinkConfig.java | 31 +++
.../mq/rocketmq/RocketMQSourceConfig.java | 30 +++
.../connector/mq/rocketmq/SinkConnectorConfig.java | 30 +++
.../mq/rocketmq/SourceConnectorConfig.java | 32 +++
.../connector/offset/OffsetStorageConfig.java | 38 +++
.../openfunction/OpenFunctionSinkConfig.java | 31 +++
.../openfunction/OpenFunctionSourceConfig.java | 31 +++
.../openfunction/SinkConnectorConfig.java | 28 +++
.../openfunction/SourceConnectorConfig.java | 27 +++
.../connector/pravega/PravegaSinkConfig.java | 31 +++
.../connector/pravega/PravegaSourceConfig.java | 31 +++
.../connector/pravega/SinkConnectorConfig.java | 46 ++++
.../connector/pravega/SourceConnectorConfig.java | 47 ++++
.../prometheus/PrometheusSourceConfig.java | 30 +++
.../prometheus/SourceConnectorConfig.java | 40 ++++
.../connector/rdb/canal/CanalSinkConfig.java | 25 ++
.../connector/rdb/canal/CanalSourceConfig.java | 66 ++++++
.../connector/rdb/canal/SinkConnectorConfig.java | 45 ++++
.../connector/rdb/canal/SourceConnectorConfig.java | 49 ++++
.../config/connector/rdb/jdbc/JdbcConfig.java | 66 ++++++
.../config/connector/rdb/jdbc/JdbcSinkConfig.java | 35 +++
.../connector/rdb/jdbc/JdbcSourceConfig.java | 30 +++
.../config/connector/rdb/jdbc/MysqlConfig.java | 54 +++++
.../connector/rdb/jdbc/SinkConnectorConfig.java | 41 ++++
.../connector/rdb/jdbc/SourceConnectorConfig.java | 76 ++++++
.../connector/rdb/mongodb/MongodbSinkConfig.java | 28 +++
.../connector/rdb/mongodb/MongodbSourceConfig.java | 28 +++
.../connector/rdb/mongodb/SinkConnectorConfig.java | 34 +++
.../rdb/mongodb/SourceConnectorConfig.java | 35 +++
.../config/connector/redis/RedisSinkConfig.java | 29 +++
.../config/connector/redis/RedisSourceConfig.java | 29 +++
.../connector/redis/SinkConnectorConfig.java | 30 +++
.../connector/redis/SourceConnectorConfig.java | 31 +++
.../common/config/connector/s3/S3SourceConfig.java | 28 +++
.../config/connector/s3/SourceConnectorConfig.java | 53 +++++
.../connector/slack/SinkConnectorConfig.java | 30 +++
.../config/connector/slack/SlackSinkConfig.java | 30 +++
.../connector/spring/SinkConnectorConfig.java | 27 +++
.../connector/spring/SourceConnectorConfig.java | 27 +++
.../config/connector/spring/SpringSinkConfig.java | 30 +++
.../connector/spring/SpringSourceConfig.java | 30 +++
.../connector/wechat/SinkConnectorConfig.java | 30 +++
.../config/connector/wechat/WeChatSinkConfig.java | 30 +++
.../connector/wecom/SinkConnectorConfig.java | 29 +++
.../config/connector/wecom/WeComSinkConfig.java | 30 +++
.../eventmesh/common/enums/ComponentType.java | 17 ++
.../grpc/adminserver/AdminBiStreamServiceGrpc.java | 260 ---------------------
.../grpc/adminserver/AdminServiceGrpc.java | 58 +++++
.../grpc/adminserver/EventMeshAdminService.java | 11 +-
.../grpc/proto/event_mesh_admin_service.proto | 22 ++
.../org/apache/eventmesh/common/remote/Job.java | 8 +
.../apache/eventmesh/common/remote/JobState.java | 20 ++
.../apache/eventmesh/common/remote/JobType.java | 7 +
.../org/apache/eventmesh/common/remote/Task.java | 17 ++
.../common/remote/exception/ErrorCode.java | 10 +
.../remote/exception/PayloadFormatException.java | 7 +
.../remote/exception/RemoteRuntimeException.java | 10 +
.../common/remote/job/DataSourceClassify.java | 8 +
.../common/remote/job/DataSourceDriverType.java | 7 +
.../common/remote/job/DataSourceType.java | 37 +++
.../common/remote/job/JobTransportType.java | 50 ++++
.../common/remote/job/SyncConsistency.java | 46 ++++
.../eventmesh/common/remote/job/SyncMode.java | 40 ++++
.../common/remote/offset/RecordOffset.java | 25 ++
.../common/remote/offset/RecordPartition.java | 25 ++
.../common/remote/offset/RecordPosition.java | 126 ++++++++++
.../common/remote/offset/S3/S3RecordOffset.java | 41 ++++
.../common/remote/offset/S3/S3RecordPartition.java | 62 +++++
.../remote/offset/canal/CanalRecordOffset.java | 40 ++++
.../remote/offset/canal/CanalRecordPartition.java | 60 +++++
.../remote/offset/file/FileRecordOffset.java | 41 ++++
.../remote/offset/file/FileRecordPartition.java | 58 +++++
.../remote/offset/kafka/KafkaRecordOffset.java | 41 ++++
.../remote/offset/kafka/KafkaRecordPartition.java | 60 +++++
.../remote/offset/pulsar/PulsarRecordOffset.java | 46 ++++
.../offset/pulsar/PulsarRecordPartition.java | 62 +++++
.../offset/rocketmq/RocketMQRecordOffset.java | 46 ++++
.../offset/rocketmq/RocketMQRecordPartition.java | 70 ++++++
.../eventmesh/common/remote/payload/IPayload.java | 4 +
.../common/remote/payload/PayloadFactory.java | 52 +++++
.../common/remote/payload/PayloadUtil.java | 27 +++
.../common/remote/request/BaseRemoteRequest.java | 31 +++
.../common/remote/request/FetchJobRequest.java | 10 +
.../remote/request/FetchPositionRequest.java | 21 ++
.../remote/request/ReportHeartBeatRequest.java | 15 ++
.../remote/request/ReportPositionRequest.java | 24 ++
.../common/remote/response/BaseRemoteResponse.java | 40 ++++
.../common/remote/response/EmptyAckResponse.java | 8 +
.../common/remote/response/FailResponse.java | 22 ++
.../common/remote/response/FetchJobResponse.java | 49 ++++
.../remote/response/FetchPositionResponse.java | 35 +++
.../org/apache/eventmesh/common/utils/IPUtils.java | 9 +-
.../apache/eventmesh/common/utils/JsonUtils.java | 37 ++-
...apache.eventmesh.common.remote.payload.IPayload | 6 +
128 files changed, 4191 insertions(+), 283 deletions(-)
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java
index 867d50b43..97286f096 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java
@@ -205,4 +205,6 @@ public class Constants {
public static final String OS_WIN_PREFIX = "win";
public static final String DEFAULT = "default";
+
+ public static final String ADMIN_SERVER_REGISTRY_NAME = "DEFAULT_GROUP@@em_adm_server";
}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/CommonConfiguration.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/CommonConfiguration.java
index 688f82860..c2a1ca69a 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/CommonConfiguration.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/CommonConfiguration.java
@@ -115,6 +115,9 @@ public class CommonConfiguration {
@ConfigField(field = "registry.plugin.password")
private String eventMeshRegistryPluginPassword = "";
+ @ConfigField(field = "registry.plugin.enabled")
+ private boolean eventMeshRegistryPluginEnabled = false;
+
public void reload() {
this.eventMeshWebhookOrigin = "eventmesh." + eventMeshIDC;
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigService.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigService.java
index 7c5b17d7e..07bdb6399 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigService.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigService.java
@@ -17,9 +17,9 @@
package org.apache.eventmesh.common.config;
-import static org.apache.eventmesh.common.utils.ReflectUtils.lookUpFieldByParentClass;
-
+import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
+import org.assertj.core.util.Strings;
import java.io.File;
import java.io.IOException;
@@ -29,9 +29,7 @@ import java.net.URL;
import java.util.Objects;
import java.util.Properties;
-import org.assertj.core.util.Strings;
-
-import lombok.Getter;
+import static org.apache.eventmesh.common.utils.ReflectUtils.lookUpFieldByParentClass;
public class ConfigService {
@@ -60,6 +58,9 @@ public class ConfigService {
}
public ConfigService setConfigPath(String configPath) {
+ if (StringUtils.isNotBlank(configPath) && !configPath.endsWith(File.separator)) {
+ configPath = configPath + File.separator;
+ }
this.configPath = configPath;
return this;
}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/Config.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/Config.java
new file mode 100644
index 000000000..d4bdee777
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/Config.java
@@ -0,0 +1,21 @@
+/*
+ * 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.eventmesh.common.config.connector;
+
+public abstract class Config {
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/Constants.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/Constants.java
new file mode 100644
index 000000000..74576e843
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/Constants.java
@@ -0,0 +1,33 @@
+/*
+ * 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.eventmesh.common.config.connector;
+
+public class Constants {
+
+ public static final String ENV_TARGET = "connectorTarget";
+
+ public static final String ENV_PORT = "connectorPort";
+
+ public static final String ENV_SOURCE_CONFIG_FILE = "sourceConnectorConf";
+
+ public static final String ENV_SINK_CONFIG_FILE = "sinkConnectorConf";
+
+ public static final int DEFAULT_ATTEMPT = 3;
+
+ public static final int DEFAULT_PORT = 8080;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/PubSubConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/PubSubConfig.java
new file mode 100644
index 000000000..be83d5112
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/PubSubConfig.java
@@ -0,0 +1,41 @@
+/*
+ * 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.eventmesh.common.config.connector;
+
+import lombok.Data;
+
+@Data
+public class PubSubConfig {
+
+ private String meshAddress;
+
+ private String subject;
+
+ private String idc;
+
+ private String env;
+
+ private String group;
+
+ private String appId;
+
+ private String userName;
+
+ private String passWord;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/SinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/SinkConfig.java
new file mode 100644
index 000000000..6cd8560c4
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/SinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector;
+
+import org.apache.eventmesh.common.config.connector.Config;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public abstract class SinkConfig extends Config {
+
+ private PubSubConfig pubSubConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/SourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/SourceConfig.java
new file mode 100644
index 000000000..763063125
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/SourceConfig.java
@@ -0,0 +1,33 @@
+/*
+ * 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.eventmesh.common.config.connector;
+
+import org.apache.eventmesh.common.config.connector.offset.OffsetStorageConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public abstract class SourceConfig extends Config {
+
+ private PubSubConfig pubSubConfig;
+
+ private OffsetStorageConfig offsetStorageConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/dingtalk/DingDingSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/dingtalk/DingDingSinkConfig.java
new file mode 100644
index 000000000..3482d5665
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/dingtalk/DingDingSinkConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.dingtalk;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DingDingSinkConfig extends SinkConfig {
+
+ private SinkConnectorConfig sinkConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/dingtalk/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/dingtalk/SinkConnectorConfig.java
new file mode 100644
index 000000000..1dfcd7664
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/dingtalk/SinkConnectorConfig.java
@@ -0,0 +1,36 @@
+/*
+ * 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.eventmesh.common.config.connector.dingtalk;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String appKey;
+
+ private String appSecret;
+
+ private String openConversationId;
+
+ private String robotCode;
+
+ private String coolAppCode;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/FileSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/FileSinkConfig.java
new file mode 100644
index 000000000..7de6daa51
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/FileSinkConfig.java
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.common.config.connector.file;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FileSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+ private Integer flushSize = 1000;
+
+ private boolean hourlyFlushEnabled = false;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/FileSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/FileSourceConfig.java
new file mode 100644
index 000000000..06bc4c174
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/FileSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.file;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FileSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/SinkConnectorConfig.java
new file mode 100644
index 000000000..ee42a1775
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/SinkConnectorConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.file;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String topic;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/SourceConnectorConfig.java
new file mode 100644
index 000000000..786d8fa74
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/file/SourceConnectorConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.file;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String filePath;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/http/HttpSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/http/HttpSourceConfig.java
new file mode 100644
index 000000000..476dfb10d
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/http/HttpSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.http;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class HttpSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/http/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/http/SourceConnectorConfig.java
new file mode 100644
index 000000000..4ffd6a134
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/http/SourceConnectorConfig.java
@@ -0,0 +1,32 @@
+/*
+ * 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.eventmesh.common.config.connector.http;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String path;
+
+ private int port;
+
+ private int idleTimeout;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/KnativeSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/KnativeSinkConfig.java
new file mode 100644
index 000000000..aff7c275a
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/KnativeSinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.knative;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class KnativeSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/KnativeSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/KnativeSourceConfig.java
new file mode 100644
index 000000000..644161d91
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/KnativeSourceConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.knative;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class KnativeSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/SinkConnectorConfig.java
new file mode 100644
index 000000000..076bd6875
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/SinkConnectorConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.knative;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ public String emurl;
+
+ public String serviceAddr;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/SourceConnectorConfig.java
new file mode 100644
index 000000000..98e781552
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/knative/SourceConnectorConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.knative;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ public String emurl;
+
+ public String serviceAddr;
+
+}
\ No newline at end of file
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/lark/LarkSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/lark/LarkSinkConfig.java
new file mode 100644
index 000000000..a9235129a
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/lark/LarkSinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.lark;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LarkSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig sinkConnectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/lark/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/lark/SinkConnectorConfig.java
new file mode 100644
index 000000000..a4895b8b2
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/lark/SinkConnectorConfig.java
@@ -0,0 +1,57 @@
+/*
+ * 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.eventmesh.common.config.connector.lark;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName = "larkSink";
+
+ /**
+ * Can not be blank
+ */
+ private String appId;
+
+ /**
+ * Can not be blank
+ */
+ private String appSecret;
+
+ /**
+ * The value is {@code open_id/user_id/union_id/email/chat_id}.
+ * Recommend to use open_id.
+ */
+ private String receiveIdType = "open_id";
+
+ /**
+ * Can not be blank.And it needs to correspond to {@code receiveIdType}
+ */
+ private String receiveId;
+
+ /**
+ * When sinking CouldEvent to lark, choose to call
+ */
+ private String sinkAsync = "true";
+
+ private String maxRetryTimes = "3";
+
+ private String retryDelayInMills = "1000";
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/KafkaSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/KafkaSinkConfig.java
new file mode 100644
index 000000000..d551f180e
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/KafkaSinkConfig.java
@@ -0,0 +1,29 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.kafka;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+
+@Data
+public class KafkaSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/KafkaSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/KafkaSourceConfig.java
new file mode 100644
index 000000000..f95f58580
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/KafkaSourceConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.kafka;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+
+@Data
+public class KafkaSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/SinkConnectorConfig.java
new file mode 100644
index 000000000..e7584319c
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/SinkConnectorConfig.java
@@ -0,0 +1,39 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.kafka;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName = "kafkaSink";
+ private String topic = "TopicTest";
+ private String ack = "all";
+ private String bootstrapServers = "127.0.0.1:9092";
+ private String keyConverter = "org.apache.kafka.common.serialization.StringSerializer";
+ private String valueConverter = "org.apache.kafka.common.serialization.StringSerializer";
+ private String maxRequestSize = "1048576";
+ private String bufferMemory = "33554432";
+ private String batchSize = "16384";
+ private String lingerMs = "0";
+ private String requestTimeoutMs = "30000";
+ private String maxInFightRequestsPerConnection = "5";
+ private String retries = "0";
+ private String compressionType = "none";
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/SourceConnectorConfig.java
new file mode 100644
index 000000000..21fb18eb2
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/kafka/SourceConnectorConfig.java
@@ -0,0 +1,36 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.kafka;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName = "kafkaSource";
+ private String topic = "TopicTest";
+ private String bootstrapServers = "127.0.0.1:9092";
+ private String groupID = "kafkaSource";
+ private String keyConverter = "org.apache.kafka.common.serialization.StringDeserializer";
+ private String valueConverter = "org.apache.kafka.common.serialization.StringDeserializer";
+ private String autoCommitIntervalMS = "1000";
+ private String enableAutoCommit = "false";
+ private String sessionTimeoutMS = "10000";
+ private String maxPollRecords = "1000";
+ private int pollTimeOut = 100;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/PulsarSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/PulsarSinkConfig.java
new file mode 100644
index 000000000..f0aaefc37
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/PulsarSinkConfig.java
@@ -0,0 +1,29 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.pulsar;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+
+@Data
+public class PulsarSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/PulsarSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/PulsarSourceConfig.java
new file mode 100644
index 000000000..f60e0f0ab
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/PulsarSourceConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.pulsar;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+
+@Data
+public class PulsarSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/SinkConnectorConfig.java
new file mode 100644
index 000000000..b66f1a532
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/SinkConnectorConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.pulsar;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String serviceUrl;
+
+ private String topic;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/SourceConnectorConfig.java
new file mode 100644
index 000000000..9f8fbce2d
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/pulsar/SourceConnectorConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.pulsar;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String serviceUrl;
+
+ private String topic;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/RabbitMQSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/RabbitMQSinkConfig.java
new file mode 100644
index 000000000..8dcb8ad50
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/RabbitMQSinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rabbitmq;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RabbitMQSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/RabbitMQSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/RabbitMQSourceConfig.java
new file mode 100644
index 000000000..c268c1005
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/RabbitMQSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rabbitmq;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RabbitMQSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/SinkConnectorConfig.java
new file mode 100644
index 000000000..a6f633f94
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/SinkConnectorConfig.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rabbitmq;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String host;
+
+ private int port;
+
+ private String username;
+
+ private String passwd;
+
+ private String virtualHost;
+
+ private String exchangeType;
+
+ private String exchangeName;
+
+ private String routingKey;
+
+ private String queueName;
+
+ private boolean autoAck;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/SourceConnectorConfig.java
new file mode 100644
index 000000000..29a041338
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rabbitmq/SourceConnectorConfig.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rabbitmq;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String host;
+
+ private int port;
+
+ private String username;
+
+ private String passwd;
+
+ private String virtualHost;
+
+ private String exchangeType;
+
+ private String exchangeName;
+
+ private String routingKey;
+
+ private String queueName;
+
+ private boolean autoAck;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/RocketMQSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/RocketMQSinkConfig.java
new file mode 100644
index 000000000..d7c08e8b7
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/RocketMQSinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rocketmq;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RocketMQSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/RocketMQSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/RocketMQSourceConfig.java
new file mode 100644
index 000000000..5c531d91c
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/RocketMQSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rocketmq;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RocketMQSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/SinkConnectorConfig.java
new file mode 100644
index 000000000..93472f7a4
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/SinkConnectorConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rocketmq;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String nameServer;
+
+ private String topic;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/SourceConnectorConfig.java
new file mode 100644
index 000000000..641d1873b
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/mq/rocketmq/SourceConnectorConfig.java
@@ -0,0 +1,32 @@
+/*
+ * 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.eventmesh.common.config.connector.mq.rocketmq;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String nameserver;
+
+ private String topic;
+
+ private long commitOffsetIntervalMs = 5 * 1000;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/offset/OffsetStorageConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/offset/OffsetStorageConfig.java
new file mode 100644
index 000000000..e8ff1d490
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/offset/OffsetStorageConfig.java
@@ -0,0 +1,38 @@
+/*
+ * 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.eventmesh.common.config.connector.offset;
+
+import org.apache.eventmesh.common.remote.job.DataSourceType;
+
+import java.util.Map;
+
+import lombok.Data;
+
+@Data
+public class OffsetStorageConfig {
+
+ private String offsetStorageType;
+
+ private String offsetStorageAddr;
+
+ private Map<String, String> extensions;
+
+ private DataSourceType dataSourceType;
+
+ private DataSourceType dataSinkType;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/OpenFunctionSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/OpenFunctionSinkConfig.java
new file mode 100644
index 000000000..151ff6883
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/OpenFunctionSinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.openfunction;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OpenFunctionSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig sinkConnectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/OpenFunctionSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/OpenFunctionSourceConfig.java
new file mode 100644
index 000000000..e3a6123ed
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/OpenFunctionSourceConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.openfunction;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OpenFunctionSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig sourceConnectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/SinkConnectorConfig.java
new file mode 100644
index 000000000..b8bc93739
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/SinkConnectorConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.openfunction;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String target;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/SourceConnectorConfig.java
new file mode 100644
index 000000000..09dbdea14
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/openfunction/SourceConnectorConfig.java
@@ -0,0 +1,27 @@
+/*
+ * 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.eventmesh.common.config.connector.openfunction;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/PravegaSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/PravegaSinkConfig.java
new file mode 100644
index 000000000..a94766c20
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/PravegaSinkConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.pravega;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PravegaSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/PravegaSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/PravegaSourceConfig.java
new file mode 100644
index 000000000..105d3474e
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/PravegaSourceConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.pravega;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PravegaSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/SinkConnectorConfig.java
new file mode 100644
index 000000000..7f56ea57a
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/SinkConnectorConfig.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common.config.connector.pravega;
+
+import java.net.URI;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private URI controllerURI;
+
+ private String scope;
+
+ private int clientPoolSize;
+
+ private int queueSize;
+
+ private boolean authEnabled;
+
+ private String username;
+
+ private String password;
+
+ private boolean tlsEnable;
+
+ private String truststore;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/SourceConnectorConfig.java
new file mode 100644
index 000000000..da0f8c5f1
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/pravega/SourceConnectorConfig.java
@@ -0,0 +1,47 @@
+/*
+ * 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.eventmesh.common.config.connector.pravega;
+
+import java.net.URI;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private URI controllerURI;
+
+ private String scope;
+
+ private int clientPoolSize;
+
+ private int queueSize;
+
+ private boolean authEnabled;
+
+ private String username;
+
+ private String password;
+
+ private boolean tlsEnable;
+
+ private String truststore;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/prometheus/PrometheusSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/prometheus/PrometheusSourceConfig.java
new file mode 100644
index 000000000..3393e4a19
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/prometheus/PrometheusSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.prometheus;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PrometheusSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/prometheus/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/prometheus/SourceConnectorConfig.java
new file mode 100644
index 000000000..1df3fe18c
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/prometheus/SourceConnectorConfig.java
@@ -0,0 +1,40 @@
+/*
+ * 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.eventmesh.common.config.connector.prometheus;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String connectorId;
+
+ private String address;
+
+ private String api;
+
+ private Long initTime;
+
+ private String query;
+
+ private Integer interval;
+
+ private String step;
+}
\ No newline at end of file
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSinkConfig.java
new file mode 100644
index 000000000..1f486403a
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSinkConfig.java
@@ -0,0 +1,25 @@
+package org.apache.eventmesh.common.config.connector.rdb.canal;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+import org.apache.eventmesh.common.remote.job.SyncMode;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CanalSinkConfig extends SinkConfig {
+
+ private Integer batchsize = 50; // 批次大小
+
+ private Boolean useBatch = true; // 是否使用batch模式
+
+ private Integer poolSize = 5; // sink模块载入线程数,针对单个载入通道
+
+ private SyncMode syncMode; // 同步模式:字段/整条记录
+
+ private Boolean skipException = false; // 是否跳过sink执行异常
+
+ public SinkConnectorConfig sinkConnectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSourceConfig.java
new file mode 100644
index 000000000..c791a3051
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSourceConfig.java
@@ -0,0 +1,66 @@
+package org.apache.eventmesh.common.config.connector.rdb.canal;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+import org.apache.eventmesh.common.remote.job.SyncConsistency;
+import org.apache.eventmesh.common.remote.job.SyncMode;
+import org.apache.eventmesh.common.remote.offset.RecordPosition;
+
+import java.util.List;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CanalSourceConfig extends SourceConfig {
+
+ private String destination;
+
+ private Long canalInstanceId;
+
+ private String desc;
+
+ private boolean ddlSync = true;
+
+ private boolean filterTableError = false;
+
+ private Long slaveId;
+
+ private Short clientId;
+
+ private Integer batchSize = 10000;
+
+ private Long batchTimeout = -1L;
+
+ private List<RecordPosition> recordPositions;
+
+ // ================================= channel parameter
+ // ================================
+
+ private Boolean enableRemedy = false; // 是否启用冲突补救算法
+
+// private RemedyAlgorithm remedyAlgorithm; // 冲突补救算法
+
+// private Integer remedyDelayThresoldForMedia; // 针对回环补救,如果反查速度过快,容易查到旧版本的数据记录,导致中美不一致,所以设置一个阀值,低于这个阀值的延迟不进行反查
+
+ private SyncMode syncMode; // 同步模式:字段/整条记录
+
+ private SyncConsistency syncConsistency; // 同步一致性要求
+
+ // ================================= system parameter
+ // ================================
+
+ private String systemSchema; // 默认为retl,不允许为空
+
+ private String systemMarkTable; // 双向同步标记表
+
+ private String systemMarkTableColumn; // 双向同步标记的列名
+
+ private String systemMarkTableInfo; // 双向同步标记的info信息,比如类似BI_SYNC
+
+ private String systemBufferTable; // otter同步buffer表
+
+ private String systemDualTable; // otter同步心跳表
+
+ private SourceConnectorConfig sourceConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/SinkConnectorConfig.java
new file mode 100644
index 000000000..c6d4a8951
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/SinkConnectorConfig.java
@@ -0,0 +1,45 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.canal;
+
+import org.apache.eventmesh.common.config.connector.rdb.jdbc.JdbcConfig;
+
+import lombok.Data;
+
+/**
+ * Configuration parameters for a sink connector.
+ */
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String url;
+
+ private String dbAddress;
+
+ private int dbPort;
+
+ private String userName;
+
+ private String passWord;
+
+ private String schemaName;
+
+ private String tableName;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/SourceConnectorConfig.java
new file mode 100644
index 000000000..b64bf1557
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/canal/SourceConnectorConfig.java
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.canal;
+
+import org.apache.eventmesh.common.config.connector.rdb.jdbc.JdbcConfig;
+import org.apache.eventmesh.common.config.connector.rdb.jdbc.MysqlConfig;
+
+import java.util.List;
+
+import lombok.Data;
+
+/**
+ * Represents the configuration for a database connector.
+ */
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String url;
+
+ private String dbAddress;
+
+ private int dbPort;
+
+ private String userName;
+
+ private String passWord;
+
+ private String schemaName;
+
+ private String tableName;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcConfig.java
new file mode 100644
index 000000000..1b46a76c9
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcConfig.java
@@ -0,0 +1,66 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.jdbc;
+
+import java.util.Properties;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * Represents the configuration for a JDBC connection.
+ */
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class JdbcConfig {
+
+ private String databaseName;
+
+ // The hostname of the database server.
+ private String hostname;
+
+ // The port number of the database server.
+ private int port;
+
+ // The username for the database connection.
+ private String user;
+
+ // The password for the database connection.
+ private String password;
+
+ private String initialStatements;
+
+ private int connectTimeout;
+
+ // e.g jdbc:mysql://127.0.0.1:3306
+ private String url;
+
+ /**
+ * Converts the JdbcConfig object to a Properties object containing the user and password.
+ *
+ * @return The Properties object representing the JdbcConfig.
+ */
+ public Properties asProperties() {
+ Properties props = new Properties();
+ props.put("user", this.user);
+ props.put("password", this.password);
+ return props;
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcSinkConfig.java
new file mode 100644
index 000000000..83711c68b
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcSinkConfig.java
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.jdbc;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JdbcSinkConfig extends SinkConfig {
+
+ private boolean supportUpsert = true;
+
+ private boolean supportDelete = true;
+
+ public SinkConnectorConfig sinkConnectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcSourceConfig.java
new file mode 100644
index 000000000..553a0581a
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/JdbcSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.jdbc;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JdbcSourceConfig extends SourceConfig {
+
+ private SourceConnectorConfig sourceConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/MysqlConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/MysqlConfig.java
new file mode 100644
index 000000000..ede507e1b
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/MysqlConfig.java
@@ -0,0 +1,54 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.jdbc;
+
+import lombok.Data;
+
+@Data
+public class MysqlConfig {
+
+ private int serverId;
+
+ private boolean keepAlive = true;
+
+ private long keepAliveInterval;
+
+ private SnapshotLockingMode snapshotLockingMode = SnapshotLockingMode.MINIMAL;
+
+ private boolean useGlobalLock = true;
+
+ public enum SnapshotLockingMode {
+
+ EXTENDED("extended"),
+
+ MINIMAL("minimal"),
+
+ NONE("none");
+
+ private final String value;
+
+ SnapshotLockingMode(String value) {
+ this.value = value;
+ }
+
+ public boolean usesLocking() {
+ return !value.equals(NONE.value);
+ }
+ }
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/SinkConnectorConfig.java
new file mode 100644
index 000000000..afbd51d14
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/SinkConnectorConfig.java
@@ -0,0 +1,41 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.jdbc;
+
+import lombok.Data;
+
+/**
+ * Configuration parameters for a sink connector.
+ */
+@Data
+public class SinkConnectorConfig {
+
+ /**
+ * The name of the sink connector.
+ */
+ private String connectorName;
+
+ /**
+ * JDBC configuration for connecting to a database.
+ */
+ private JdbcConfig jdbcConfig;
+
+ public String getDatabaseType() {
+ return "mysql";
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/SourceConnectorConfig.java
new file mode 100644
index 000000000..a10d8e09d
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/jdbc/SourceConnectorConfig.java
@@ -0,0 +1,76 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.jdbc;
+
+import java.util.List;
+
+import lombok.Data;
+
+/**
+ * Represents the configuration for a database connector.
+ */
+@Data
+public class SourceConnectorConfig {
+
+ private static final int DEFAULT_SNAPSHOT_FETCH_SIZE = 100;
+
+ /**
+ * Max task number,The maximum cannot exceed the number of tables scanned. If it exceeds, it will be set to the number of tables.
+ */
+ private int maxTask;
+
+ private int batchMaxRows;
+
+ private boolean skipSnapshot = false;
+
+ // A list of database names to include in the connector.
+ private List<String> databaseIncludeList;
+
+ // A list of database names to exclude from the connector.
+ private List<String> databaseExcludeList;
+
+ // A list of table names to include in the connector.
+ private List<String> tableIncludeList;
+
+ // A list of table names to exclude from the connector.
+ private List<String> tableExcludeList;
+
+ // database type e.g. mysql
+ private String databaseType;
+
+ private int snapshotMaxThreads;
+
+ // The snapshot mode also require handling the database schema (database and table schema)
+ private boolean snapshotSchema = true;
+
+ // The snapshot mode require handling table data
+ private boolean snapshotData = true;
+
+ private int snapshotFetchSize = DEFAULT_SNAPSHOT_FETCH_SIZE;
+
+ private JdbcConfig jdbcConfig;
+
+ private boolean skipViews = false;
+
+ private boolean skipComments = false;
+
+ // The configuration for the MySQL database.
+ private MysqlConfig mysqlConfig;
+
+ private String name = "mysql-connector";
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/MongodbSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/MongodbSinkConfig.java
new file mode 100644
index 000000000..b168f25e8
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/MongodbSinkConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.mongodb;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+
+@Data
+public class MongodbSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/MongodbSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/MongodbSourceConfig.java
new file mode 100644
index 000000000..ca52fadcd
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/MongodbSourceConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.mongodb;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+
+@Data
+public class MongodbSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SinkConnectorConfig.java
new file mode 100644
index 000000000..58ae5ffc4
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SinkConnectorConfig.java
@@ -0,0 +1,34 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.mongodb;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String connectorType;
+
+ private String url;
+
+ private String database;
+
+ private String collection;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SourceConnectorConfig.java
new file mode 100644
index 000000000..8ace602f8
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SourceConnectorConfig.java
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.common.config.connector.rdb.mongodb;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String connectorType;
+
+ private String url;
+
+ private String database;
+
+ private String collection;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/RedisSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/RedisSinkConfig.java
new file mode 100644
index 000000000..4d90bfc1a
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/RedisSinkConfig.java
@@ -0,0 +1,29 @@
+/*
+ * 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.eventmesh.common.config.connector.redis;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+
+@Data
+public class RedisSinkConfig extends SinkConfig {
+
+ public SinkConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/RedisSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/RedisSourceConfig.java
new file mode 100644
index 000000000..e11cb9481
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/RedisSourceConfig.java
@@ -0,0 +1,29 @@
+/*
+ * 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.eventmesh.common.config.connector.redis;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+
+@Data
+public class RedisSourceConfig extends SourceConfig {
+
+ public SourceConnectorConfig connectorConfig;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/SinkConnectorConfig.java
new file mode 100644
index 000000000..ebf53adc3
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/SinkConnectorConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.redis;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String server;
+
+ private String topic;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/SourceConnectorConfig.java
new file mode 100644
index 000000000..b363924ec
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/redis/SourceConnectorConfig.java
@@ -0,0 +1,31 @@
+/*
+ * 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.eventmesh.common.config.connector.redis;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String server;
+
+ private String topic;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/s3/S3SourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/s3/S3SourceConfig.java
new file mode 100644
index 000000000..f603d7acd
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/s3/S3SourceConfig.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eventmesh.common.config.connector.s3;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+
+@Data
+public class S3SourceConfig extends SourceConfig {
+
+ private SourceConnectorConfig sourceConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/s3/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/s3/SourceConnectorConfig.java
new file mode 100644
index 000000000..fdc453125
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/s3/SourceConnectorConfig.java
@@ -0,0 +1,53 @@
+/*
+ * 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.eventmesh.common.config.connector.s3;
+
+import java.util.Map;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+ private String region;
+
+ private String bucket;
+
+ private String accessKey;
+
+ private String secretKey;
+
+ private String fileName;
+
+ /**
+ * The schema for the data to be read from S3.
+ */
+ private Map<String/* column name */, Integer/* bytes */> schema;
+
+ /**
+ * The maximum number of records that should be returned in each batch poll.
+ */
+ private Integer batchSize = 20;
+
+ /**
+ * The maximum ms to wait for request futures to complete.
+ */
+ private long timeout = 3000;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/slack/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/slack/SinkConnectorConfig.java
new file mode 100644
index 000000000..4267beddf
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/slack/SinkConnectorConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.slack;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String appToken;
+
+ private String channelId;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/slack/SlackSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/slack/SlackSinkConfig.java
new file mode 100644
index 000000000..969306ae6
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/slack/SlackSinkConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.slack;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SlackSinkConfig extends SinkConfig {
+
+ private SinkConnectorConfig sinkConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SinkConnectorConfig.java
new file mode 100644
index 000000000..0ded9886d
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SinkConnectorConfig.java
@@ -0,0 +1,27 @@
+/*
+ * 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.eventmesh.common.config.connector.spring;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SourceConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SourceConnectorConfig.java
new file mode 100644
index 000000000..c31f8c988
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SourceConnectorConfig.java
@@ -0,0 +1,27 @@
+/*
+ * 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.eventmesh.common.config.connector.spring;
+
+import lombok.Data;
+
+@Data
+public class SourceConnectorConfig {
+
+ private String connectorName;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SpringSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SpringSinkConfig.java
new file mode 100644
index 000000000..14f1f4bbe
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SpringSinkConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.spring;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SpringSinkConfig extends SinkConfig {
+
+ private SinkConnectorConfig sinkConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SpringSourceConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SpringSourceConfig.java
new file mode 100644
index 000000000..e99dfc594
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/spring/SpringSourceConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.spring;
+
+import org.apache.eventmesh.common.config.connector.SourceConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SpringSourceConfig extends SourceConfig {
+
+ private SourceConnectorConfig sourceConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wechat/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wechat/SinkConnectorConfig.java
new file mode 100644
index 000000000..95ca5e64c
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wechat/SinkConnectorConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.wechat;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String appId;
+
+ private String appSecret;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wechat/WeChatSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wechat/WeChatSinkConfig.java
new file mode 100644
index 000000000..e968202c4
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wechat/WeChatSinkConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.wechat;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WeChatSinkConfig extends SinkConfig {
+
+ private SinkConnectorConfig sinkConnectorConfig;
+}
\ No newline at end of file
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wecom/SinkConnectorConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wecom/SinkConnectorConfig.java
new file mode 100644
index 000000000..b32b5b7d3
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wecom/SinkConnectorConfig.java
@@ -0,0 +1,29 @@
+/*
+ * 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.eventmesh.common.config.connector.wecom;
+
+import lombok.Data;
+
+@Data
+public class SinkConnectorConfig {
+
+ private String connectorName;
+
+ private String robotWebhookKey;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wecom/WeComSinkConfig.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wecom/WeComSinkConfig.java
new file mode 100644
index 000000000..5177baa44
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/wecom/WeComSinkConfig.java
@@ -0,0 +1,30 @@
+/*
+ * 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.eventmesh.common.config.connector.wecom;
+
+import org.apache.eventmesh.common.config.connector.SinkConfig;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WeComSinkConfig extends SinkConfig {
+
+ private SinkConnectorConfig sinkConnectorConfig;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/enums/ComponentType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/enums/ComponentType.java
new file mode 100644
index 000000000..fb400cbb1
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/enums/ComponentType.java
@@ -0,0 +1,17 @@
+package org.apache.eventmesh.common.enums;
+
+public enum ComponentType {
+ CONNECTOR("connector"),
+ FUNCTION("function"),
+ MESH("mesh");
+
+ public String name;
+
+ ComponentType(String name) {
+ this.name = name;
+ }
+
+ public String componentTypeName() {
+ return this.name;
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminBiStreamServiceGrpc.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminBiStreamServiceGrpc.java
deleted file mode 100644
index 21df4d9b0..000000000
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminBiStreamServiceGrpc.java
+++ /dev/null
@@ -1,260 +0,0 @@
-package org.apache.eventmesh.common.protocol.grpc.adminserver;
-
-import static io.grpc.MethodDescriptor.generateFullMethodName;
-
-/**
- */
-@javax.annotation.Generated(
- value = "by gRPC proto compiler (version 1.40.0)",
- comments = "Source: event_mesh_admin_service.proto")
-@io.grpc.stub.annotations.GrpcGenerated
-public final class AdminBiStreamServiceGrpc {
-
- private AdminBiStreamServiceGrpc() {}
-
- public static final String SERVICE_NAME = "AdminBiStreamService";
-
- // Static method descriptors that strictly reflect the proto.
- private static volatile io.grpc.MethodDescriptor<Payload,
- Payload> getInvokeBiStreamMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "invokeBiStream",
- requestType = Payload.class,
- responseType = Payload.class,
- methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
- public static io.grpc.MethodDescriptor<Payload,
- Payload> getInvokeBiStreamMethod() {
- io.grpc.MethodDescriptor<Payload, Payload> getInvokeBiStreamMethod;
- if ((getInvokeBiStreamMethod = AdminBiStreamServiceGrpc.getInvokeBiStreamMethod) == null) {
- synchronized (AdminBiStreamServiceGrpc.class) {
- if ((getInvokeBiStreamMethod = AdminBiStreamServiceGrpc.getInvokeBiStreamMethod) == null) {
- AdminBiStreamServiceGrpc.getInvokeBiStreamMethod = getInvokeBiStreamMethod =
- io.grpc.MethodDescriptor.<Payload, Payload>newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "invokeBiStream"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- Payload.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- Payload.getDefaultInstance()))
- .setSchemaDescriptor(new AdminBiStreamServiceMethodDescriptorSupplier("invokeBiStream"))
- .build();
- }
- }
- }
- return getInvokeBiStreamMethod;
- }
-
- /**
- * Creates a new async stub that supports all call types for the service
- */
- public static AdminBiStreamServiceStub newStub(io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory<AdminBiStreamServiceStub> factory =
- new io.grpc.stub.AbstractStub.StubFactory<AdminBiStreamServiceStub>() {
- @Override
- public AdminBiStreamServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AdminBiStreamServiceStub(channel, callOptions);
- }
- };
- return AdminBiStreamServiceStub.newStub(factory, channel);
- }
-
- /**
- * Creates a new blocking-style stub that supports unary and streaming output calls on the service
- */
- public static AdminBiStreamServiceBlockingStub newBlockingStub(
- io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory<AdminBiStreamServiceBlockingStub> factory =
- new io.grpc.stub.AbstractStub.StubFactory<AdminBiStreamServiceBlockingStub>() {
- @Override
- public AdminBiStreamServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AdminBiStreamServiceBlockingStub(channel, callOptions);
- }
- };
- return AdminBiStreamServiceBlockingStub.newStub(factory, channel);
- }
-
- /**
- * Creates a new ListenableFuture-style stub that supports unary calls on the service
- */
- public static AdminBiStreamServiceFutureStub newFutureStub(
- io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory<AdminBiStreamServiceFutureStub> factory =
- new io.grpc.stub.AbstractStub.StubFactory<AdminBiStreamServiceFutureStub>() {
- @Override
- public AdminBiStreamServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AdminBiStreamServiceFutureStub(channel, callOptions);
- }
- };
- return AdminBiStreamServiceFutureStub.newStub(factory, channel);
- }
-
- /**
- */
- public static abstract class AdminBiStreamServiceImplBase implements io.grpc.BindableService {
-
- /**
- */
- public io.grpc.stub.StreamObserver<Payload> invokeBiStream(
- io.grpc.stub.StreamObserver<Payload> responseObserver) {
- return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getInvokeBiStreamMethod(), responseObserver);
- }
-
- @Override public final io.grpc.ServerServiceDefinition bindService() {
- return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
- .addMethod(
- getInvokeBiStreamMethod(),
- io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
- new MethodHandlers<
- Payload,
- Payload>(
- this, METHODID_INVOKE_BI_STREAM)))
- .build();
- }
- }
-
- /**
- */
- public static final class AdminBiStreamServiceStub extends io.grpc.stub.AbstractAsyncStub<AdminBiStreamServiceStub> {
- private AdminBiStreamServiceStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @Override
- protected AdminBiStreamServiceStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AdminBiStreamServiceStub(channel, callOptions);
- }
-
- /**
- */
- public io.grpc.stub.StreamObserver<Payload> invokeBiStream(
- io.grpc.stub.StreamObserver<Payload> responseObserver) {
- return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
- getChannel().newCall(getInvokeBiStreamMethod(), getCallOptions()), responseObserver);
- }
- }
-
- /**
- */
- public static final class AdminBiStreamServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<AdminBiStreamServiceBlockingStub> {
- private AdminBiStreamServiceBlockingStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @Override
- protected AdminBiStreamServiceBlockingStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AdminBiStreamServiceBlockingStub(channel, callOptions);
- }
- }
-
- /**
- */
- public static final class AdminBiStreamServiceFutureStub extends io.grpc.stub.AbstractFutureStub<AdminBiStreamServiceFutureStub> {
- private AdminBiStreamServiceFutureStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @Override
- protected AdminBiStreamServiceFutureStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AdminBiStreamServiceFutureStub(channel, callOptions);
- }
- }
-
- private static final int METHODID_INVOKE_BI_STREAM = 0;
-
- private static final class MethodHandlers<Req, Resp> implements
- io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
- io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
- io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
- io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
- private final AdminBiStreamServiceImplBase serviceImpl;
- private final int methodId;
-
- MethodHandlers(AdminBiStreamServiceImplBase serviceImpl, int methodId) {
- this.serviceImpl = serviceImpl;
- this.methodId = methodId;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
- switch (methodId) {
- default:
- throw new AssertionError();
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public io.grpc.stub.StreamObserver<Req> invoke(
- io.grpc.stub.StreamObserver<Resp> responseObserver) {
- switch (methodId) {
- case METHODID_INVOKE_BI_STREAM:
- return (io.grpc.stub.StreamObserver<Req>) serviceImpl.invokeBiStream(
- (io.grpc.stub.StreamObserver<Payload>) responseObserver);
- default:
- throw new AssertionError();
- }
- }
- }
-
- private static abstract class AdminBiStreamServiceBaseDescriptorSupplier
- implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
- AdminBiStreamServiceBaseDescriptorSupplier() {}
-
- @Override
- public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
- return EventMeshAdminService.getDescriptor();
- }
-
- @Override
- public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
- return getFileDescriptor().findServiceByName("AdminBiStreamService");
- }
- }
-
- private static final class AdminBiStreamServiceFileDescriptorSupplier
- extends AdminBiStreamServiceBaseDescriptorSupplier {
- AdminBiStreamServiceFileDescriptorSupplier() {}
- }
-
- private static final class AdminBiStreamServiceMethodDescriptorSupplier
- extends AdminBiStreamServiceBaseDescriptorSupplier
- implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
- private final String methodName;
-
- AdminBiStreamServiceMethodDescriptorSupplier(String methodName) {
- this.methodName = methodName;
- }
-
- @Override
- public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
- return getServiceDescriptor().findMethodByName(methodName);
- }
- }
-
- private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
-
- public static io.grpc.ServiceDescriptor getServiceDescriptor() {
- io.grpc.ServiceDescriptor result = serviceDescriptor;
- if (result == null) {
- synchronized (AdminBiStreamServiceGrpc.class) {
- result = serviceDescriptor;
- if (result == null) {
- serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
- .setSchemaDescriptor(new AdminBiStreamServiceFileDescriptorSupplier())
- .addMethod(getInvokeBiStreamMethod())
- .build();
- }
- }
- }
- return result;
- }
-}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminServiceGrpc.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminServiceGrpc.java
index 0b1b7119b..7af7076fe 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminServiceGrpc.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/AdminServiceGrpc.java
@@ -15,6 +15,37 @@ public final class AdminServiceGrpc {
public static final String SERVICE_NAME = "AdminService";
// Static method descriptors that strictly reflect the proto.
+ private static volatile io.grpc.MethodDescriptor<Payload,
+ Payload> getInvokeBiStreamMethod;
+
+ @io.grpc.stub.annotations.RpcMethod(
+ fullMethodName = SERVICE_NAME + '/' + "invokeBiStream",
+ requestType = Payload.class,
+ responseType = Payload.class,
+ methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
+ public static io.grpc.MethodDescriptor<Payload,
+ Payload> getInvokeBiStreamMethod() {
+ io.grpc.MethodDescriptor<Payload, Payload> getInvokeBiStreamMethod;
+ if ((getInvokeBiStreamMethod = AdminServiceGrpc.getInvokeBiStreamMethod) == null) {
+ synchronized (AdminServiceGrpc.class) {
+ if ((getInvokeBiStreamMethod = AdminServiceGrpc.getInvokeBiStreamMethod) == null) {
+ AdminServiceGrpc.getInvokeBiStreamMethod = getInvokeBiStreamMethod =
+ io.grpc.MethodDescriptor.<Payload, Payload>newBuilder()
+ .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
+ .setFullMethodName(generateFullMethodName(SERVICE_NAME, "invokeBiStream"))
+ .setSampledToLocalTracing(true)
+ .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+ Payload.getDefaultInstance()))
+ .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+ Payload.getDefaultInstance()))
+ .setSchemaDescriptor(new AdminServiceMethodDescriptorSupplier("invokeBiStream"))
+ .build();
+ }
+ }
+ }
+ return getInvokeBiStreamMethod;
+ }
+
private static volatile io.grpc.MethodDescriptor<Payload,
Payload> getInvokeMethod;
@@ -94,6 +125,13 @@ public final class AdminServiceGrpc {
*/
public static abstract class AdminServiceImplBase implements io.grpc.BindableService {
+ /**
+ */
+ public io.grpc.stub.StreamObserver<Payload> invokeBiStream(
+ io.grpc.stub.StreamObserver<Payload> responseObserver) {
+ return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getInvokeBiStreamMethod(), responseObserver);
+ }
+
/**
*/
public void invoke(Payload request,
@@ -103,6 +141,13 @@ public final class AdminServiceGrpc {
@Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
+ .addMethod(
+ getInvokeBiStreamMethod(),
+ io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
+ new MethodHandlers<
+ Payload,
+ Payload>(
+ this, METHODID_INVOKE_BI_STREAM)))
.addMethod(
getInvokeMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
@@ -128,6 +173,14 @@ public final class AdminServiceGrpc {
return new AdminServiceStub(channel, callOptions);
}
+ /**
+ */
+ public io.grpc.stub.StreamObserver<Payload> invokeBiStream(
+ io.grpc.stub.StreamObserver<Payload> responseObserver) {
+ return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
+ getChannel().newCall(getInvokeBiStreamMethod(), getCallOptions()), responseObserver);
+ }
+
/**
*/
public void invoke(Payload request,
@@ -183,6 +236,7 @@ public final class AdminServiceGrpc {
}
private static final int METHODID_INVOKE = 0;
+ private static final int METHODID_INVOKE_BI_STREAM = 1;
private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
@@ -215,6 +269,9 @@ public final class AdminServiceGrpc {
public io.grpc.stub.StreamObserver<Req> invoke(
io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
+ case METHODID_INVOKE_BI_STREAM:
+ return (io.grpc.stub.StreamObserver<Req>) serviceImpl.invokeBiStream(
+ (io.grpc.stub.StreamObserver<Payload>) responseObserver);
default:
throw new AssertionError();
}
@@ -266,6 +323,7 @@ public final class AdminServiceGrpc {
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new AdminServiceFileDescriptorSupplier())
+ .addMethod(getInvokeBiStreamMethod())
.addMethod(getInvokeMethod())
.build();
}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/EventMeshAdminService.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/EventMeshAdminService.java
index 7d4c3ee1b..5fdd39ed5 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/EventMeshAdminService.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/adminserver/EventMeshAdminService.java
@@ -40,12 +40,11 @@ public final class EventMeshAdminService {
"/protobuf/any.proto\"q\n\010Metadata\022\014\n\004type\030" +
"\003 \001(\t\022\'\n\007headers\030\007 \003(\0132\026.Metadata.Header" +
"sEntry\032.\n\014HeadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" +
- "alue\030\002 \001(\t:\0028\001\"J\n\007Payload\022\033\n\010metadata\030\002 " +
- "\001(\0132\t.Metadata\022\"\n\004body\030\003 \001(\0132\024.google.pr" +
- "otobuf.Any2B\n\024AdminBiStreamService\022*\n\016in" +
- "vokeBiStream\022\010.Payload\032\010.Payload\"\000(\0010\00124" +
- "\n\014AdminService\022$\n\014invokeStream\022\010.Payload" +
- "\032\010.Payload\"\000B\002P\001b\006proto3"
+ "alue\030\002 \001(\t:\0028\001\"4\n\007Payload\022\033\n\010metadata\030\002 " +
+ "\001(\0132\t.Metadata\022\014\n\004body\030\003 \001(\0142Z\n\014AdminSer" +
+ "vice\022*\n\016invokeBiStream\022\010.Payload\032\010.Paylo" +
+ "ad\"\000(\0010\001\022\036\n\006invoke\022\010.Payload\032\010.Payload\"\000" +
+ "B\002P\001b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/proto/event_mesh_admin_service.proto b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/proto/event_mesh_admin_service.proto
new file mode 100644
index 000000000..7f9f3ec30
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/proto/event_mesh_admin_service.proto
@@ -0,0 +1,22 @@
+syntax="proto3";
+
+import "google/protobuf/any.proto";
+
+option java_multiple_files=true;
+
+message Metadata {
+ string type = 3;
+ map<string, string> headers = 7;
+}
+
+
+message Payload {
+ Metadata metadata = 2;
+ bytes body = 3;
+}
+
+service AdminService {
+ rpc invokeBiStream(stream Payload) returns (stream Payload){}
+ rpc invoke(Payload) returns (Payload){}
+}
+
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/Job.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/Job.java
new file mode 100644
index 000000000..ab5e6363d
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/Job.java
@@ -0,0 +1,8 @@
+package org.apache.eventmesh.common.remote;
+
+public class Job {
+ private long id;
+ private long taskID;
+ private JobType type;
+ private JobState state;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/JobState.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/JobState.java
new file mode 100644
index 000000000..d970464f6
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/JobState.java
@@ -0,0 +1,20 @@
+package org.apache.eventmesh.common.remote;
+
+public enum JobState {
+ INIT,
+ STARTED,
+ RUNNING,
+ PAUSE,
+ COMPLETE,
+ DELETE,
+ FAIL;
+ private static final JobState[] STATES = JobState.values();
+
+ public static JobState fromIndex(Integer index) {
+ if (index == null || index < 0 || index >= STATES.length) {
+ return null;
+ }
+
+ return STATES[index];
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/JobType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/JobType.java
new file mode 100644
index 000000000..e4dbddbf6
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/JobType.java
@@ -0,0 +1,7 @@
+package org.apache.eventmesh.common.remote;
+
+public enum JobType {
+ FULL,
+ INCREASE,
+ STRUCT_SYNC
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/Task.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/Task.java
new file mode 100644
index 000000000..06128c7c0
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/Task.java
@@ -0,0 +1,17 @@
+package org.apache.eventmesh.common.remote;
+
+// task : job = 1 : m
+public class Task {
+ private long id;
+ private String name;
+ private String desc;
+ private String uid;
+ private String sourceUser;
+ private String sourcePasswd;
+ private String targetUser;
+ private String targetPasswd;
+ private int sourceType;
+ private int targetType;
+
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/ErrorCode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/ErrorCode.java
new file mode 100644
index 000000000..73f29d9bf
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/ErrorCode.java
@@ -0,0 +1,10 @@
+package org.apache.eventmesh.common.remote.exception;
+
+public class ErrorCode {
+ public static final int SUCCESS = 0;
+ public static final int BAD_REQUEST = 4001;
+ public static final int BAD_DB_DATA = 4002;
+
+ public static final int INTERNAL_ERR = 5000;
+ public static final int STARTUP_CONFIG_MISS = 5001;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/PayloadFormatException.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/PayloadFormatException.java
new file mode 100644
index 000000000..0160fc0cd
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/PayloadFormatException.java
@@ -0,0 +1,7 @@
+package org.apache.eventmesh.common.remote.exception;
+
+public class PayloadFormatException extends RemoteRuntimeException {
+ public PayloadFormatException(int code, String desc) {
+ super(code, desc);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/RemoteRuntimeException.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/RemoteRuntimeException.java
new file mode 100644
index 000000000..299a2c938
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/exception/RemoteRuntimeException.java
@@ -0,0 +1,10 @@
+package org.apache.eventmesh.common.remote.exception;
+
+public class RemoteRuntimeException extends RuntimeException{
+ protected final int code;
+ protected final String message;
+ public RemoteRuntimeException(int code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceClassify.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceClassify.java
new file mode 100644
index 000000000..cb3b77d18
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceClassify.java
@@ -0,0 +1,8 @@
+package org.apache.eventmesh.common.remote.job;
+
+public enum DataSourceClassify {
+ // relationship db
+ RDB,
+ MQ,
+ CACHE;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceDriverType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceDriverType.java
new file mode 100644
index 000000000..43d8e6e77
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceDriverType.java
@@ -0,0 +1,7 @@
+package org.apache.eventmesh.common.remote.job;
+
+public enum DataSourceDriverType {
+ MYSQL,
+ REDIS,
+ ROCKETMQ;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceType.java
new file mode 100644
index 000000000..28f91cb4e
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/DataSourceType.java
@@ -0,0 +1,37 @@
+package org.apache.eventmesh.common.remote.job;
+
+public enum DataSourceType {
+ MYSQL("MySQL", DataSourceDriverType.MYSQL, DataSourceClassify.RDB),
+ REDIS("Redis", DataSourceDriverType.REDIS, DataSourceClassify.CACHE),
+ ROCKETMQ("RocketMQ", DataSourceDriverType.ROCKETMQ, DataSourceClassify.MQ);
+ private final String name;
+ private final DataSourceDriverType driverType;
+ private final DataSourceClassify classify;
+
+ DataSourceType(String name, DataSourceDriverType driverType, DataSourceClassify classify) {
+ this.name = name;
+ this.driverType = driverType;
+ this.classify = classify;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public DataSourceDriverType getDriverType() {
+ return driverType;
+ }
+
+ public DataSourceClassify getClassify() {
+ return classify;
+ }
+
+ private static final DataSourceType[] TYPES = DataSourceType.values();
+
+ public static DataSourceType getDataSourceType(Integer index) {
+ if (index == null || index < 0 || index >= TYPES.length) {
+ return null;
+ }
+ return TYPES[index];
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/JobTransportType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/JobTransportType.java
new file mode 100644
index 000000000..4357167d6
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/JobTransportType.java
@@ -0,0 +1,50 @@
+package org.apache.eventmesh.common.remote.job;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum JobTransportType {
+ MYSQL_MYSQL(DataSourceType.MYSQL, DataSourceType.MYSQL),
+ REDIS_REDIS(DataSourceType.REDIS, DataSourceType.REDIS),
+ ROCKETMQ_ROCKETMQ(DataSourceType.ROCKETMQ,DataSourceType.ROCKETMQ);
+ private static final Map<String,JobTransportType> INDEX_TYPES = new HashMap<>();
+ private static final JobTransportType[] TYPES = JobTransportType.values();
+ private static final String SEPARATOR = "@";
+ static {
+ for (JobTransportType type : TYPES) {
+ INDEX_TYPES.put(generateKey(type.src, type.dst),type);
+ }
+ }
+
+ DataSourceType src;
+
+ DataSourceType dst;
+
+ JobTransportType(DataSourceType src, DataSourceType dst) {
+ this.src = src;
+ this.dst = dst;
+ }
+
+ private static String generateKey(DataSourceType src, DataSourceType dst) {
+ return src.ordinal() + SEPARATOR + dst.ordinal();
+ }
+
+ public DataSourceType getSrc() {
+ return src;
+ }
+
+ public DataSourceType getDst() {
+ return dst;
+ }
+
+ public static JobTransportType getJobTransportType(DataSourceType src, DataSourceType dst) {
+ return INDEX_TYPES.get(generateKey(src,dst));
+ }
+
+ public static JobTransportType getJobTransportType(Integer index) {
+ if (index == null || index < 0 || index >= TYPES.length) {
+ return null;
+ }
+ return TYPES[index];
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncConsistency.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncConsistency.java
new file mode 100644
index 000000000..14b0da3a3
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncConsistency.java
@@ -0,0 +1,46 @@
+package org.apache.eventmesh.common.remote.job;
+
+public enum SyncConsistency {
+ /** 基于当前介质最新数据 */
+ MEDIA("M"),
+ /** 基于当前的store记录的数据 */
+ STORE("S"),
+ /** 基于当前的变更value,最终一致性 */
+ BASE("B");
+
+ private String value;
+
+ SyncConsistency(String value){
+ this.value = value;
+ }
+
+ public static SyncConsistency valuesOf(String value) {
+ SyncConsistency[] modes = values();
+ for (SyncConsistency mode : modes) {
+ if (mode.value.equalsIgnoreCase(value)) {
+ return mode;
+ }
+ }
+ return null;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public boolean isMedia() {
+ return this.equals(SyncConsistency.MEDIA);
+ }
+
+ public boolean isStore() {
+ return this.equals(SyncConsistency.STORE);
+ }
+
+ public boolean isBase() {
+ return this.equals(SyncConsistency.BASE);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncMode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncMode.java
new file mode 100644
index 000000000..79074021c
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncMode.java
@@ -0,0 +1,40 @@
+package org.apache.eventmesh.common.remote.job;
+
+public enum SyncMode {
+ /** 行记录 */
+ ROW("R"),
+ /** 字段记录 */
+ FIELD("F");
+
+ private String value;
+
+ SyncMode(String value){
+ this.value = value;
+ }
+
+ public static SyncMode valuesOf(String value) {
+ SyncMode[] modes = values();
+ for (SyncMode mode : modes) {
+ if (mode.value.equalsIgnoreCase(value)) {
+ return mode;
+ }
+ }
+ return null;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public boolean isRow() {
+ return this.equals(SyncMode.ROW);
+ }
+
+ public boolean isField() {
+ return this.equals(SyncMode.FIELD);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordOffset.java
new file mode 100644
index 000000000..4bf3713d1
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordOffset.java
@@ -0,0 +1,25 @@
+/*
+ * 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.eventmesh.common.remote.offset;
+
+public abstract class RecordOffset {
+ public abstract Class<? extends RecordOffset> getRecordOffsetClass();
+ public RecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordPartition.java
new file mode 100644
index 000000000..803f0e308
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordPartition.java
@@ -0,0 +1,25 @@
+/*
+ * 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.eventmesh.common.remote.offset;
+
+public abstract class RecordPartition {
+ public abstract Class<? extends RecordPartition> getRecordPartitionClass();
+ public RecordPartition() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordPosition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordPosition.java
new file mode 100644
index 000000000..fbfdd1854
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/RecordPosition.java
@@ -0,0 +1,126 @@
+/*
+ * 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.eventmesh.common.remote.offset;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import org.apache.eventmesh.common.remote.offset.S3.S3RecordOffset;
+import org.apache.eventmesh.common.remote.offset.S3.S3RecordPartition;
+import org.apache.eventmesh.common.remote.offset.canal.CanalRecordOffset;
+import org.apache.eventmesh.common.remote.offset.canal.CanalRecordPartition;
+import org.apache.eventmesh.common.remote.offset.file.FileRecordOffset;
+import org.apache.eventmesh.common.remote.offset.file.FileRecordPartition;
+import org.apache.eventmesh.common.remote.offset.kafka.KafkaRecordOffset;
+import org.apache.eventmesh.common.remote.offset.kafka.KafkaRecordPartition;
+import org.apache.eventmesh.common.remote.offset.pulsar.PulsarRecordOffset;
+import org.apache.eventmesh.common.remote.offset.pulsar.PulsarRecordPartition;
+import org.apache.eventmesh.common.remote.offset.rocketmq.RocketMQRecordOffset;
+import org.apache.eventmesh.common.remote.offset.rocketmq.RocketMQRecordPartition;
+
+import java.util.Objects;
+
+public class RecordPosition {
+ @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
+ @JsonSubTypes({
+ @JsonSubTypes.Type(value = CanalRecordPartition.class, name = "CanalRecordPartition"),
+ @JsonSubTypes.Type(value = FileRecordPartition.class, name = "FileRecordPartition"),
+ @JsonSubTypes.Type(value = S3RecordPartition.class, name = "S3RecordPartition"),
+ @JsonSubTypes.Type(value = KafkaRecordPartition.class, name = "KafkaRecordPartition"),
+ @JsonSubTypes.Type(value = PulsarRecordPartition.class, name = "PulsarRecordPartition"),
+ @JsonSubTypes.Type(value = RocketMQRecordPartition.class, name = "RocketMQRecordPartition"),
+ })
+ private RecordPartition recordPartition;
+
+ private Class<? extends RecordPartition> recordPartitionClazz;
+
+ @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
+ @JsonSubTypes({
+ @JsonSubTypes.Type(value = CanalRecordOffset.class, name = "CanalRecordOffset"),
+ @JsonSubTypes.Type(value = FileRecordOffset.class, name = "FileRecordOffset"),
+ @JsonSubTypes.Type(value = S3RecordOffset.class, name = "S3RecordOffset"),
+ @JsonSubTypes.Type(value = KafkaRecordOffset.class, name = "KafkaRecordOffset"),
+ @JsonSubTypes.Type(value = PulsarRecordOffset.class, name = "PulsarRecordOffset"),
+ @JsonSubTypes.Type(value = RocketMQRecordOffset.class, name = "RocketMQRecordOffset"),
+ })
+ private RecordOffset recordOffset;
+
+ private Class<? extends RecordOffset> recordOffsetClazz;
+
+ public RecordPosition() {
+
+ }
+
+ public RecordPosition(
+ RecordPartition recordPartition, RecordOffset recordOffset) {
+ this.recordPartition = recordPartition;
+ this.recordOffset = recordOffset;
+ this.recordPartitionClazz = recordPartition.getRecordPartitionClass();
+ this.recordOffsetClazz = recordOffset.getRecordOffsetClass();
+ }
+
+ public void setRecordPartition(RecordPartition recordPartition) {
+ this.recordPartition = recordPartition;
+ if (recordPartition == null) {
+ this.recordPartitionClazz = null;
+ return;
+ }
+ this.recordPartitionClazz = recordPartition.getRecordPartitionClass();
+ }
+
+ public void setRecordOffset(RecordOffset recordOffset) {
+ this.recordOffset = recordOffset;
+ if (recordOffset == null) {
+ this.recordOffsetClazz = null;
+ return;
+ }
+ this.recordOffsetClazz = recordOffset.getRecordOffsetClass();
+ }
+
+ public RecordPartition getRecordPartition() {
+ return recordPartition;
+ }
+
+ public RecordOffset getRecordOffset() {
+ return recordOffset;
+ }
+
+ public Class<? extends RecordPartition> getRecordPartitionClazz() {
+ return recordPartitionClazz;
+ }
+
+ public Class<? extends RecordOffset> getRecordOffsetClazz() {
+ return recordOffsetClazz;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof RecordPosition)) {
+ return false;
+ }
+ RecordPosition position = (RecordPosition) o;
+ return recordPartition.equals(position.recordPartition) && recordOffset.equals(position.recordOffset);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(recordPartition, recordOffset);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/S3/S3RecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/S3/S3RecordOffset.java
new file mode 100644
index 000000000..9f38e4b2c
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/S3/S3RecordOffset.java
@@ -0,0 +1,41 @@
+/*
+ * 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.eventmesh.common.remote.offset.S3;
+
+import org.apache.eventmesh.common.remote.offset.RecordOffset;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class S3RecordOffset extends RecordOffset {
+
+ private Long offset;
+
+ @Override
+ public Class<? extends RecordOffset> getRecordOffsetClass() {
+ return S3RecordOffset.class;
+ }
+
+ public S3RecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/S3/S3RecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/S3/S3RecordPartition.java
new file mode 100644
index 000000000..6f1b901bd
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/S3/S3RecordPartition.java
@@ -0,0 +1,62 @@
+/*
+ * 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.eventmesh.common.remote.offset.S3;
+
+import lombok.Data;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordPartition;
+
+import java.util.Objects;
+
+
+@Data
+@ToString
+public class S3RecordPartition extends RecordPartition {
+
+ private String region;
+
+ private String bucket;
+
+ private String fileName;
+
+ @Override
+ public Class<? extends RecordPartition> getRecordPartitionClass() {
+ return S3RecordPartition.class;
+ }
+
+ public S3RecordPartition() {
+ super();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ S3RecordPartition that = (S3RecordPartition) o;
+ return Objects.equals(fileName, that.fileName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(fileName);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalRecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalRecordOffset.java
new file mode 100644
index 000000000..749e12dcc
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalRecordOffset.java
@@ -0,0 +1,40 @@
+/*
+ * 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.eventmesh.common.remote.offset.canal;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordOffset;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class CanalRecordOffset extends RecordOffset {
+
+ private Long offset;
+
+ @Override
+ public Class<? extends RecordOffset> getRecordOffsetClass() {
+ return CanalRecordOffset.class;
+ }
+
+ public CanalRecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalRecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalRecordPartition.java
new file mode 100644
index 000000000..7eb9e8c6e
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalRecordPartition.java
@@ -0,0 +1,60 @@
+/*
+ * 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.eventmesh.common.remote.offset.canal;
+
+import lombok.Data;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordPartition;
+
+import java.util.Objects;
+
+
+@Data
+@ToString
+public class CanalRecordPartition extends RecordPartition {
+
+ private String journalName;
+
+ private Long timeStamp;
+
+ @Override
+ public Class<? extends RecordPartition> getRecordPartitionClass() {
+ return CanalRecordPartition.class;
+ }
+
+ public CanalRecordPartition() {
+ super();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CanalRecordPartition that = (CanalRecordPartition) o;
+ return Objects.equals(journalName, that.journalName) && Objects.equals(timeStamp, that.timeStamp);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(journalName, timeStamp);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/file/FileRecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/file/FileRecordOffset.java
new file mode 100644
index 000000000..cda293cb8
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/file/FileRecordOffset.java
@@ -0,0 +1,41 @@
+/*
+ * 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.eventmesh.common.remote.offset.file;
+
+import org.apache.eventmesh.common.remote.offset.RecordOffset;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class FileRecordOffset extends RecordOffset {
+
+ private Long offset;
+
+ @Override
+ public Class<? extends RecordOffset> getRecordOffsetClass() {
+ return FileRecordOffset.class;
+ }
+
+ public FileRecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/file/FileRecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/file/FileRecordPartition.java
new file mode 100644
index 000000000..413789786
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/file/FileRecordPartition.java
@@ -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.
+ */
+
+package org.apache.eventmesh.common.remote.offset.file;
+
+import lombok.Data;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordPartition;
+
+import java.util.Objects;
+
+
+@Data
+@ToString
+public class FileRecordPartition extends RecordPartition {
+
+ private String fileName;
+
+ @Override
+ public Class<? extends RecordPartition> getRecordPartitionClass() {
+ return FileRecordPartition.class;
+ }
+
+ public FileRecordPartition() {
+ super();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileRecordPartition that = (FileRecordPartition) o;
+ return Objects.equals(fileName, that.fileName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(fileName);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/kafka/KafkaRecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/kafka/KafkaRecordOffset.java
new file mode 100644
index 000000000..134ef06fe
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/kafka/KafkaRecordOffset.java
@@ -0,0 +1,41 @@
+/*
+ * 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.eventmesh.common.remote.offset.kafka;
+
+import org.apache.eventmesh.common.remote.offset.RecordOffset;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class KafkaRecordOffset extends RecordOffset {
+
+ private Long offset;
+
+ @Override
+ public Class<? extends RecordOffset> getRecordOffsetClass() {
+ return KafkaRecordOffset.class;
+ }
+
+ public KafkaRecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/kafka/KafkaRecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/kafka/KafkaRecordPartition.java
new file mode 100644
index 000000000..b0c431355
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/kafka/KafkaRecordPartition.java
@@ -0,0 +1,60 @@
+/*
+ * 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.eventmesh.common.remote.offset.kafka;
+
+import lombok.Data;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordPartition;
+
+import java.util.Objects;
+
+
+@Data
+@ToString
+public class KafkaRecordPartition extends RecordPartition {
+
+ private String topic;
+
+ private Integer partition;
+
+ @Override
+ public Class<? extends RecordPartition> getRecordPartitionClass() {
+ return KafkaRecordPartition.class;
+ }
+
+ public KafkaRecordPartition() {
+ super();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ KafkaRecordPartition that = (KafkaRecordPartition) o;
+ return Objects.equals(topic, that.topic) && Objects.equals(partition, that.partition);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(topic, partition);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/pulsar/PulsarRecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/pulsar/PulsarRecordOffset.java
new file mode 100644
index 000000000..bbe3d4380
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/pulsar/PulsarRecordOffset.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common.remote.offset.pulsar;
+
+import org.apache.eventmesh.common.remote.offset.RecordOffset;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class PulsarRecordOffset extends RecordOffset {
+
+ /**
+ * if pull message from mq
+ * key=queueOffset,
+ * value=queueOffset value
+ */
+ private Long queueOffset;
+
+ @Override
+ public Class<? extends RecordOffset> getRecordOffsetClass() {
+ return PulsarRecordOffset.class;
+ }
+
+ public PulsarRecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/pulsar/PulsarRecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/pulsar/PulsarRecordPartition.java
new file mode 100644
index 000000000..349152029
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/pulsar/PulsarRecordPartition.java
@@ -0,0 +1,62 @@
+/*
+ * 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.eventmesh.common.remote.offset.pulsar;
+
+import lombok.Data;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordPartition;
+
+import java.util.Objects;
+
+
+@Data
+@ToString
+public class PulsarRecordPartition extends RecordPartition {
+
+ private String topic;
+
+ private Long queueId;
+
+
+ @Override
+ public Class<? extends RecordPartition> getRecordPartitionClass() {
+ return PulsarRecordPartition.class;
+ }
+
+ public PulsarRecordPartition() {
+ super();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ PulsarRecordPartition that = (PulsarRecordPartition) o;
+ return Objects.equals(topic, that.topic) && Objects.equals(queueId,
+ that.queueId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(topic, queueId);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/rocketmq/RocketMQRecordOffset.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/rocketmq/RocketMQRecordOffset.java
new file mode 100644
index 000000000..56094c9e7
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/rocketmq/RocketMQRecordOffset.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common.remote.offset.rocketmq;
+
+import org.apache.eventmesh.common.remote.offset.RecordOffset;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class RocketMQRecordOffset extends RecordOffset {
+
+ /**
+ * if pull message from mq
+ * key=queueOffset,
+ * value=queueOffset value
+ */
+ private Long queueOffset;
+
+ @Override
+ public Class<? extends RecordOffset> getRecordOffsetClass() {
+ return RocketMQRecordOffset.class;
+ }
+
+ public RocketMQRecordOffset() {
+
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/rocketmq/RocketMQRecordPartition.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/rocketmq/RocketMQRecordPartition.java
new file mode 100644
index 000000000..6af9c3860
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/offset/rocketmq/RocketMQRecordPartition.java
@@ -0,0 +1,70 @@
+/*
+ * 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.eventmesh.common.remote.offset.rocketmq;
+
+import lombok.Data;
+import lombok.ToString;
+import org.apache.eventmesh.common.remote.offset.RecordPartition;
+
+import java.util.Objects;
+
+
+@Data
+@ToString
+public class RocketMQRecordPartition extends RecordPartition {
+
+ /**
+ * key=topic,value=topicName
+ * key=brokerName,value=brokerName
+ * key=queueId,value=queueId
+ */
+
+ private String broker;
+
+ private String topic;
+
+ private String queueId;
+
+
+ @Override
+ public Class<? extends RecordPartition> getRecordPartitionClass() {
+ return RocketMQRecordPartition.class;
+ }
+
+ public RocketMQRecordPartition() {
+ super();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ RocketMQRecordPartition that = (RocketMQRecordPartition) o;
+ return Objects.equals(broker, that.broker) && Objects.equals(topic, that.topic) && Objects.equals(queueId,
+ that.queueId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(broker, topic, queueId);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/IPayload.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/IPayload.java
new file mode 100644
index 000000000..7224da76e
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/IPayload.java
@@ -0,0 +1,4 @@
+package org.apache.eventmesh.common.remote.payload;
+
+public interface IPayload {
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/PayloadFactory.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/PayloadFactory.java
new file mode 100644
index 000000000..15f9350ac
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/PayloadFactory.java
@@ -0,0 +1,52 @@
+package org.apache.eventmesh.common.remote.payload;
+
+import java.lang.reflect.Modifier;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class PayloadFactory {
+ private PayloadFactory(){
+ }
+
+ private static class PayloadFactoryHolder {
+ private static final PayloadFactory INSTANCE = new PayloadFactory();
+ }
+
+ public static PayloadFactory getInstance(){
+ return PayloadFactoryHolder.INSTANCE;
+ }
+
+ private final Map<String, Class<?>> registryPayload = new ConcurrentHashMap<>();
+
+ private boolean initialized = false;
+
+ public void init() {
+ scan();
+ }
+
+ private synchronized void scan() {
+ if (initialized) {
+ return;
+ }
+ ServiceLoader<IPayload> payloads = ServiceLoader.load(IPayload.class);
+ for (IPayload payload : payloads) {
+ register(payload.getClass().getSimpleName(), payload.getClass());
+ }
+ initialized = true;
+ }
+
+ public void register(String type, Class<?> clazz) {
+ if (Modifier.isAbstract(clazz.getModifiers())) {
+ return;
+ }
+ if (registryPayload.containsKey(type)) {
+ throw new RuntimeException(String.format("Fail to register, type:%s ,clazz:%s ", type, clazz.getName()));
+ }
+ registryPayload.put(type, clazz);
+ }
+
+ public Class<?> getClassByType(String type) {
+ return registryPayload.get(type);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/PayloadUtil.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/PayloadUtil.java
new file mode 100644
index 000000000..e467087f8
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/payload/PayloadUtil.java
@@ -0,0 +1,27 @@
+package org.apache.eventmesh.common.remote.payload;
+
+import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream;
+import com.google.protobuf.Any;
+import com.google.protobuf.UnsafeByteOperations;
+import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata;
+import org.apache.eventmesh.common.protocol.grpc.adminserver.Payload;
+import org.apache.eventmesh.common.remote.exception.ErrorCode;
+import org.apache.eventmesh.common.remote.exception.PayloadFormatException;
+import org.apache.eventmesh.common.utils.JsonUtils;
+
+public class PayloadUtil {
+ public static Payload from(IPayload payload) {
+ byte[] payloadBytes = JsonUtils.toJSONBytes(payload);
+ Metadata.Builder metadata = Metadata.newBuilder().setType(payload.getClass().getSimpleName());
+ return Payload.newBuilder().setMetadata(metadata).setBody(Any.newBuilder().setValue(UnsafeByteOperations.unsafeWrap(payloadBytes))).build();
+ }
+
+ public static IPayload parse(Payload payload) {
+ Class<?> targetClass = PayloadFactory.getInstance().getClassByType(payload.getMetadata().getType());
+ if (targetClass == null) {
+ throw new PayloadFormatException(ErrorCode.BAD_REQUEST,
+ "unknown payload type:" + payload.getMetadata().getType());
+ }
+ return (IPayload)JsonUtils.parseObject(new ByteBufferBackedInputStream(payload.getBody().getValue().asReadOnlyByteBuffer()), targetClass);
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/BaseRemoteRequest.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/BaseRemoteRequest.java
new file mode 100644
index 000000000..35717e015
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/BaseRemoteRequest.java
@@ -0,0 +1,31 @@
+package org.apache.eventmesh.common.remote.request;
+
+import lombok.Getter;
+import org.apache.eventmesh.common.remote.payload.IPayload;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Getter
+public abstract class BaseRemoteRequest implements IPayload {
+ private Map<String, String> header = new HashMap<>();
+
+ public void addHeader(String key, String value) {
+ if (key == null || value == null) {
+ return;
+ }
+ header.put(key,value);
+ }
+
+ public void addHeaders(Map<String,String> map) {
+ if (map == null || map.isEmpty()) {
+ return;
+ }
+ map.forEach((k,v) -> {
+ if (k == null || v == null) {
+ return;
+ }
+ this.header.put(k,v);
+ });
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/FetchJobRequest.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/FetchJobRequest.java
new file mode 100644
index 000000000..9caaaf1fe
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/FetchJobRequest.java
@@ -0,0 +1,10 @@
+package org.apache.eventmesh.common.remote.request;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FetchJobRequest extends BaseRemoteRequest {
+ private String jobID;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/FetchPositionRequest.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/FetchPositionRequest.java
new file mode 100644
index 000000000..4d3c1f753
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/FetchPositionRequest.java
@@ -0,0 +1,21 @@
+package org.apache.eventmesh.common.remote.request;
+
+import org.apache.eventmesh.common.remote.job.DataSourceType;
+import org.apache.eventmesh.common.remote.offset.RecordPosition;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FetchPositionRequest extends BaseRemoteRequest {
+
+ private String jobID;
+
+ private String address;
+
+ private RecordPosition recordPosition;
+
+ private DataSourceType dataSourceType;
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/ReportHeartBeatRequest.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/ReportHeartBeatRequest.java
new file mode 100644
index 000000000..997672cc7
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/ReportHeartBeatRequest.java
@@ -0,0 +1,15 @@
+package org.apache.eventmesh.common.remote.request;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ReportHeartBeatRequest extends BaseRemoteRequest {
+
+ private String address;
+
+ private String reportedTimeStamp;
+
+ private String jobID;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/ReportPositionRequest.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/ReportPositionRequest.java
new file mode 100644
index 000000000..08a7c6da7
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/request/ReportPositionRequest.java
@@ -0,0 +1,24 @@
+package org.apache.eventmesh.common.remote.request;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.eventmesh.common.remote.JobState;
+import org.apache.eventmesh.common.remote.job.DataSourceType;
+import org.apache.eventmesh.common.remote.offset.RecordPosition;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ReportPositionRequest extends BaseRemoteRequest {
+
+ private String jobID;
+
+ private List<RecordPosition> recordPositionList;
+
+ private JobState state;
+
+ private String address;
+
+ private DataSourceType dataSourceType;
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/BaseRemoteResponse.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/BaseRemoteResponse.java
new file mode 100644
index 000000000..81c054264
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/BaseRemoteResponse.java
@@ -0,0 +1,40 @@
+package org.apache.eventmesh.common.remote.response;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.eventmesh.common.remote.payload.IPayload;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Getter
+public abstract class BaseRemoteResponse implements IPayload {
+ public static final int UNKNOWN = -1;
+ @Setter
+ private boolean success = true;
+ @Setter
+ private int errorCode;
+ @Setter
+ private String desc;
+
+ private Map<String, String> header = new HashMap<>();
+
+ public void addHeader(String key, String value) {
+ if (key == null || value == null) {
+ return;
+ }
+ header.put(key,value);
+ }
+
+ public void addHeaders(Map<String,String> map) {
+ if (map == null || map.isEmpty()) {
+ return;
+ }
+ map.forEach((k,v) -> {
+ if (k == null || v == null) {
+ return;
+ }
+ this.header.put(k,v);
+ });
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/EmptyAckResponse.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/EmptyAckResponse.java
new file mode 100644
index 000000000..8ef3a73c9
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/EmptyAckResponse.java
@@ -0,0 +1,8 @@
+package org.apache.eventmesh.common.remote.response;
+
+/**
+ * empty, just mean remote received request
+ */
+public class EmptyAckResponse extends BaseRemoteResponse {
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FailResponse.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FailResponse.java
new file mode 100644
index 000000000..3dd690eb0
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FailResponse.java
@@ -0,0 +1,22 @@
+package org.apache.eventmesh.common.remote.response;
+
+public class FailResponse extends BaseRemoteResponse {
+ public static FailResponse build(int errorCode, String msg) {
+ FailResponse response = new FailResponse();
+ response.setErrorCode(errorCode);
+ response.setDesc(msg);
+ response.setSuccess(false);
+ return response;
+ }
+
+
+ /**
+ * build an error response.
+ *
+ * @param exception exception
+ * @return response
+ */
+ public static FailResponse build(Throwable exception) {
+ return build(BaseRemoteResponse.UNKNOWN, exception.getMessage());
+ }
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FetchJobResponse.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FetchJobResponse.java
new file mode 100644
index 000000000..507f878c8
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FetchJobResponse.java
@@ -0,0 +1,49 @@
+package org.apache.eventmesh.common.remote.response;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.eventmesh.common.remote.JobState;
+import org.apache.eventmesh.common.remote.exception.ErrorCode;
+import org.apache.eventmesh.common.remote.job.JobTransportType;
+import org.apache.eventmesh.common.remote.offset.RecordPosition;
+
+import java.util.Map;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FetchJobResponse extends BaseRemoteResponse {
+
+ private Integer id;
+
+ private String name;
+
+ private JobTransportType transportType;
+
+ private Map<String, Object> sourceConnectorConfig;
+
+ private String sourceConnectorDesc;
+
+ private Map<String, Object> sinkConnectorConfig;
+
+ private String sinkConnectorDesc;
+
+ private RecordPosition position;
+
+ private JobState state;
+
+ public static FetchJobResponse successResponse() {
+ FetchJobResponse response = new FetchJobResponse();
+ response.setSuccess(true);
+ response.setErrorCode(ErrorCode.SUCCESS);
+ return response;
+ }
+
+ public static FetchJobResponse failResponse(int code, String desc) {
+ FetchJobResponse response = new FetchJobResponse();
+ response.setSuccess(false);
+ response.setErrorCode(code);
+ response.setDesc(desc);
+ return response;
+ }
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FetchPositionResponse.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FetchPositionResponse.java
new file mode 100644
index 000000000..067131b40
--- /dev/null
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/response/FetchPositionResponse.java
@@ -0,0 +1,35 @@
+package org.apache.eventmesh.common.remote.response;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.eventmesh.common.remote.exception.ErrorCode;
+import org.apache.eventmesh.common.remote.offset.RecordPosition;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FetchPositionResponse extends BaseRemoteResponse {
+
+ private RecordPosition recordPosition;
+
+ public static FetchPositionResponse successResponse() {
+ FetchPositionResponse response = new FetchPositionResponse();
+ response.setSuccess(true);
+ response.setErrorCode(ErrorCode.SUCCESS);
+ return response;
+ }
+
+ public static FetchPositionResponse successResponse(RecordPosition recordPosition) {
+ FetchPositionResponse response = successResponse();
+ response.setRecordPosition(recordPosition);
+ return response;
+ }
+
+ public static FetchPositionResponse failResponse(int code, String desc) {
+ FetchPositionResponse response = new FetchPositionResponse();
+ response.setSuccess(false);
+ response.setErrorCode(code);
+ response.setDesc(desc);
+ return response;
+ }
+
+}
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java
index 998735181..cd3e5c7f6 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java
@@ -46,7 +46,9 @@ import inet.ipaddr.IPAddressString;
@Slf4j
public class IPUtils {
- public static String getLocalAddress() {
+ public static String localAddress = init();
+
+ private static String init() {
// if the progress works under docker environment
// return the host ip about this docker located from environment value
String dockerHostIp = System.getenv("docker_host_ip");
@@ -114,6 +116,11 @@ public class IPUtils {
return null;
}
+ public static String getLocalAddress() {
+ return localAddress;
+
+ }
+
public static boolean isValidIPV4Address(String ip) {
// Regex for digit from 0 to 255.
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/JsonUtils.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/JsonUtils.java
index 71d42e345..a1ea6ee59 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/JsonUtils.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/JsonUtils.java
@@ -17,17 +17,6 @@
package org.apache.eventmesh.common.utils;
-import org.apache.eventmesh.common.Constants;
-import org.apache.eventmesh.common.EventMeshDateFormat;
-import org.apache.eventmesh.common.exception.JsonException;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.Objects;
-
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -36,6 +25,16 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.common.Constants;
+import org.apache.eventmesh.common.EventMeshDateFormat;
+import org.apache.eventmesh.common.exception.JsonException;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Type;
+import java.util.Map;
+import java.util.Objects;
/**
* Json serialize or deserialize utils.
@@ -108,6 +107,14 @@ public class JsonUtils {
}
}
+ public static <T> T parseObject(InputStream inputStream, Class<T> clazz) {
+ try {
+ return OBJECT_MAPPER.readValue(inputStream, clazz);
+ } catch (IOException e) {
+ throw new JsonException("deserialize input stream to object error",e);
+ }
+ }
+
public static <T> T parseObject(String text, Type type) {
if (StringUtils.isEmpty(text)) {
return null;
@@ -156,6 +163,14 @@ public class JsonUtils {
}
}
+ public static <T> T parseTypeReferenceObject(byte[] text, TypeReference<T> typeReference) {
+ try {
+ return OBJECT_MAPPER.readValue(text, typeReference);
+ } catch (IOException e) {
+ throw new JsonException("deserialize json string to typeReference error", e);
+ }
+ }
+
public static JsonNode getJsonNode(String text) {
if (StringUtils.isEmpty(text)) {
return null;
diff --git a/eventmesh-common/src/main/resources/META-INF/services/org.apache.eventmesh.common.remote.payload.IPayload b/eventmesh-common/src/main/resources/META-INF/services/org.apache.eventmesh.common.remote.payload.IPayload
new file mode 100644
index 000000000..d5bfb9477
--- /dev/null
+++ b/eventmesh-common/src/main/resources/META-INF/services/org.apache.eventmesh.common.remote.payload.IPayload
@@ -0,0 +1,6 @@
+org.apache.eventmesh.common.remote.request.FetchJobRequest
+org.apache.eventmesh.common.remote.response.FetchJobResponse
+org.apache.eventmesh.common.remote.request.ReportPositionRequest
+org.apache.eventmesh.common.remote.request.ReportHeartBeatRequest
+org.apache.eventmesh.common.remote.request.FetchPositionRequest
+org.apache.eventmesh.common.remote.response.FetchPositionResponse
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org