From ad4bd7afd91af0df0f33984153ac64dd7e25809c Mon Sep 17 00:00:00 2001
From: Lambert Rao <101875596+Lambert-Rao@users.noreply.github.com>
Date: Mon, 22 Jan 2024 19:48:45 +0800
Subject: [PATCH 1/3] [ISSUE #20] Add dependency of console module (#19)
* refactor: add dependency of console module and move controllers into console module.
* fix: add logback config, fix application-dev.yml and move `` to root `pom.xml` as pointed out in PR#19.
---
eventmesh-dashboard-common/pom.xml | 16 ++++-
eventmesh-dashboard-console/pom.xml | 61 +++++++++++++++++--
.../console/EventmeshConsoleApplication.java | 38 ++++++++++++
.../eventmesh/dashboard/console/Main.java | 7 ---
.../src/main/resources/application-dev.yml | 51 ++++++++++++++++
.../src/main/resources/application.yml | 38 ++++++++++++
.../src/main/resources/logback.xml | 50 +++++++++++++++
eventmesh-dashboard-core/pom.xml | 22 ++-----
.../src/main/resources/application-dev.yml | 2 +-
pom.xml | 18 ++++++
10 files changed, 272 insertions(+), 31 deletions(-)
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
delete mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/Main.java
create mode 100644 eventmesh-dashboard-console/src/main/resources/application-dev.yml
create mode 100644 eventmesh-dashboard-console/src/main/resources/application.yml
create mode 100644 eventmesh-dashboard-console/src/main/resources/logback.xml
diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml
index 4247216f..f79bd00c 100644
--- a/eventmesh-dashboard-common/pom.xml
+++ b/eventmesh-dashboard-common/pom.xml
@@ -13,9 +13,21 @@
eventmesh-dashboard-common
- 8
- 8
+ 1.8
UTF-8
+ UTF-8
+ 2.7.6
+
+
+ junit
+ junit
+
+
+ org.projectlombok
+ lombok
+
+
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml
index 2042c89c..fa06c450 100644
--- a/eventmesh-dashboard-console/pom.xml
+++ b/eventmesh-dashboard-console/pom.xml
@@ -1,7 +1,7 @@
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
org.apache.eventmesh.dashboard
@@ -13,9 +13,62 @@
eventmesh-dashboard-console
- 8
- 8
+ 1.8
UTF-8
+ UTF-8
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+ org.springdoc
+ springdoc-openapi-ui
+ 1.7.0
+
+
+ org.springdoc
+ springdoc-openapi-javadoc
+ 1.7.0
+
+
+
+
+ org.apache.eventmesh.dashboard.common
+ eventmesh-dashboard-common
+ 0.0.1-SNAPSHOT
+
+
+ org.apache.eventmesh.dashboard.service
+ eventmesh-dashboard-service
+ 0.0.1-SNAPSHOT
+
+
+
+
+ com.alibaba
+ druid-spring-boot-starter
+ 1.2.21
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
+
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
new file mode 100644
index 00000000..1e4d6dba
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.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.dashboard.console;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+
+@Slf4j
+@SpringBootApplication
+@ComponentScan({"org.apache.eventmesh.dashboard.service", "org.apache.eventmesh.dashboard.console"})
+public class EventmeshConsoleApplication {
+
+ public static void main(String[] args) {
+ try {
+ SpringApplication.run(EventmeshConsoleApplication.class, args);
+ log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName());
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/Main.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/Main.java
deleted file mode 100644
index 7e966a20..00000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/Main.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.eventmesh.dashboard.console;
-
-public class Main {
- public static void main(String[] args) {
- System.out.println("Hello world!");
- }
-}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/resources/application-dev.yml b/eventmesh-dashboard-console/src/main/resources/application-dev.yml
new file mode 100644
index 00000000..bfe02806
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/resources/application-dev.yml
@@ -0,0 +1,51 @@
+#
+# 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.
+#
+
+server:
+ port: 9898
+ servlet:
+ context-path: "/eventmesh"
+
+spring:
+ servlet:
+ multipart:
+ max-file-size: 500MB
+ max-request-size: 500MB
+ application:
+ name: eventmesh-console
+ datasource:
+ name: eventmesh-console
+ type: com.alibaba.druid.pool.DruidDataSource
+ druid:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://localhost:3306/eventmesh-dashboard?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
+ username: root
+ password: root
+
+ initial-size: 1
+ max-active: 50
+ min-idle: 5
+ max-wait: 6000
+ validation-query: select 'x'
+ validation-query-timeout: 15
+ test-on-borrow: false
+ test-while-idle: true
+ min-evictable-idle-time-millis: 300000
+
+
+
+
diff --git a/eventmesh-dashboard-console/src/main/resources/application.yml b/eventmesh-dashboard-console/src/main/resources/application.yml
new file mode 100644
index 00000000..f39890e9
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/resources/application.yml
@@ -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.
+#
+
+spring:
+ application:
+ name: eventmesh-dashboard
+ profiles:
+ active: dev
+
+logging:
+ config: classpath:logback.xml
+
+mybatis:
+ checkConfig-location: false
+ configuration:
+ useGeneratedKeys: true
+ mapUnderscoreToCamelCase: true
+
+
+pagehelper:
+ helperDialect: mysql
+ reasonable: true
+ supportMethodsArguments: true
+ params: count=countSql
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/resources/logback.xml b/eventmesh-dashboard-console/src/main/resources/logback.xml
new file mode 100644
index 00000000..c9925d33
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/resources/logback.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n
+
+
+
+
+ ${user.home}/logs/eventmesh-dashboard.log
+ true
+
+ ${user.home}/logs/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log
+
+
+ 104857600
+
+ 10
+
+
+ [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n
+ UTF-8
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml
index 98ade695..651cad83 100644
--- a/eventmesh-dashboard-core/pom.xml
+++ b/eventmesh-dashboard-core/pom.xml
@@ -57,11 +57,6 @@
spring-boot-configuration-processor
true
-
- org.projectlombok
- lombok
- true
-
org.springframework.boot
spring-boot-starter-test
@@ -69,6 +64,11 @@
+
+ org.apache.eventmesh.dashboard.common
+ eventmesh-dashboard-common
+ 0.0.1-SNAPSHOT
+
org.apache.commons
commons-lang3
@@ -80,18 +80,6 @@
2.0.40
-
-
- org.springdoc
- springdoc-openapi-ui
- 1.7.0
-
-
- org.springdoc
- springdoc-openapi-javadoc
- 1.7.0
-
-
org.mockito
diff --git a/eventmesh-dashboard-core/src/main/resources/application-dev.yml b/eventmesh-dashboard-core/src/main/resources/application-dev.yml
index 91377864..f61a3c39 100644
--- a/eventmesh-dashboard-core/src/main/resources/application-dev.yml
+++ b/eventmesh-dashboard-core/src/main/resources/application-dev.yml
@@ -21,7 +21,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/eventmesh-dashboard?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
- password:
+ password: root
initial-size: 1
max-active: 50
diff --git a/pom.xml b/pom.xml
index 3abf4205..ed8fd4fb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,6 +78,8 @@
8
8
UTF-8
+ 2.7.6
+ 2.3.2
@@ -87,4 +89,20 @@
eventmesh-dashboard-service
eventmesh-dashboard-common
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ ${spring-boot.version}
+ pom
+ import
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+ ${mybatis-spring-boot.version}
+
+
+
\ No newline at end of file
From 828b8f94f2af1310aafc0f1584bb1ade03e16379 Mon Sep 17 00:00:00 2001
From: Pil0tXia
Date: Fri, 26 Jan 2024 20:28:34 +0800
Subject: [PATCH 2/3] [ISSUE #23] Integrate Checkstyle into Build and CI
process (#24)
* integrate checkstyle
* fix import order & remove excessive try-catch
---
.asf.yaml | 4 +--
.github/workflows/{build.yaml => docker.yml} | 0
README.md | 2 +-
.../eventmesh/dashboard/common/Main.java | 18 ++++++++++++-
.../console/EventmeshConsoleApplication.java | 11 +++-----
.../dashboard/core/service/Main.java | 7 -----
.../eventmesh/dashboard/observe/Main.java | 18 ++++++++++++-
.../eventmesh/dashboard/service/Main.java | 18 ++++++++++++-
pom.xml | 27 +++++++++++++++++++
style/checkStyle.xml | 2 +-
10 files changed, 86 insertions(+), 21 deletions(-)
rename .github/workflows/{build.yaml => docker.yml} (100%)
delete mode 100644 eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java
diff --git a/.asf.yaml b/.asf.yaml
index 9ff78571..898b57a2 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -45,9 +45,9 @@ github:
dismiss_stale_reviews: true
required_approving_review_count: 1
notifications:
- commits: commits@eventmesh.apache.org
+ commits: commits@eventmesh.apache.org
# Send all issue emails (new, closed, comments) to issues@
- issues: issues@eventmesh.apache.org
+ issues: issues@eventmesh.apache.org
# Send new/closed PR notifications to dev@
pullrequests_status: dev@eventmesh.apache.org
# Send individual PR comments/reviews to issues@
diff --git a/.github/workflows/build.yaml b/.github/workflows/docker.yml
similarity index 100%
rename from .github/workflows/build.yaml
rename to .github/workflows/docker.yml
diff --git a/README.md b/README.md
index 5ddd5f57..bf6fbb59 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@
1. eventmesh-dashboard-console 业务模块的代码,调用service接口
2. eventmesh-dashboard-observe 监控模块的代码
-3. eventmesh-dashboard-core 对eventmesh以及相关组件的代码,提供service实现
+3. eventmesh-dashboard-core 对EventMesh Runtime, Meta以及相关组件的代码,提供service实现
4. eventmesh-dashboard-service 公用API接口,对core的抽象
5. eventmesh-dashboard-common 公共模块的代码
6. eventmesh-dashboard-view 前端代码
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java
index a8b0ff7c..673282d6 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java
@@ -1,7 +1,23 @@
+/*
+ * 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.dashboard.common;
public class Main {
public static void main(String[] args) {
- System.out.println("Hello world!");
}
}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
index 1e4d6dba..a048f24c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
@@ -17,22 +17,19 @@
package org.apache.eventmesh.dashboard.console;
-import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
+import lombok.extern.slf4j.Slf4j;
+
@Slf4j
@SpringBootApplication
@ComponentScan({"org.apache.eventmesh.dashboard.service", "org.apache.eventmesh.dashboard.console"})
public class EventmeshConsoleApplication {
public static void main(String[] args) {
- try {
- SpringApplication.run(EventmeshConsoleApplication.class, args);
- log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName());
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
+ SpringApplication.run(EventmeshConsoleApplication.class, args);
+ log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName());
}
}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java
deleted file mode 100644
index f538cd86..00000000
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.eventmesh.dashboard.core.service;
-
-public class Main {
- public static void main(String[] args) {
- System.out.println("Hello world!");
- }
-}
\ No newline at end of file
diff --git a/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java b/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java
index 1a8fac32..dc40fa22 100644
--- a/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java
+++ b/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java
@@ -1,7 +1,23 @@
+/*
+ * 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.dashboard.observe;
public class Main {
public static void main(String[] args) {
- System.out.println("Hello world!");
}
}
\ No newline at end of file
diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java
index 0927abf9..926f48c5 100644
--- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java
+++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java
@@ -1,7 +1,23 @@
+/*
+ * 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.dashboard.service;
public class Main {
public static void main(String[] args) {
- System.out.println("Hello world!");
}
}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index ed8fd4fb..e8ac69c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -89,6 +89,7 @@
eventmesh-dashboard-service
eventmesh-dashboard-common
+
@@ -105,4 +106,30 @@
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.3.1
+
+ style/checkStyle.xml
+ true
+ true
+ false
+ config_loc=style
+
+
+
+ validate
+ validate
+
+ check
+
+
+
+
+
+
\ No newline at end of file
diff --git a/style/checkStyle.xml b/style/checkStyle.xml
index cfa19728..897dbfa2 100644
--- a/style/checkStyle.xml
+++ b/style/checkStyle.xml
@@ -23,7 +23,7 @@
-
+
From f7f3a6083b18484d3a3167982c44310074756944 Mon Sep 17 00:00:00 2001
From: Lambert Rao <101875596+Lambert-Rao@users.noreply.github.com>
Date: Mon, 29 Jan 2024 21:36:21 +0800
Subject: [PATCH 3/3] [ISSUE #21] Implement Connection related code (#22)
* fixes #21
ADD:
connection related code:
Connection/Client/Connector: Mapper,Entity
Connection: ConnectionService,ConnectionDataService
others:
eventmesh-dashboard.sql
test resources
MODIFY:
pom file: remove dependency of junit, spring-boot-starter-test contains it.
pom file: let service module depend on core module.
* [ISSUE #23] Integrate Checkstyle into Build and CI process (#24)
* integrate checkstyle
* fix import order & remove excessive try-catch
* [ISSUE #23] Integrate Checkstyle into Build and CI process (#24)
* integrate checkstyle
* fix import order & remove excessive try-catch
* fixes #21
fixed according to PR#22 conversation
Database schema definition modified
* fix checkstyle for ConnectorMapper
* fix: add StatusEnum
add enum support for entity class.
* fix: rename KubernetesPodStatus
* fix checkstyle
---------
Co-authored-by: Pil0tXia
---
eventmesh-dashboard-common/pom.xml | 4 -
...ava => EventMeshDashboardApplication.java} | 8 +-
.../console/config/SchedulerConfig.java | 33 +++++
.../console/config/SpringDocConfig.java | 42 ++++++
.../dashboard/console/constant/ApiPrefix.java | 24 ++++
.../connection/ConnectionController.java | 25 ++++
.../console/dto/ConnectionResponse.java | 69 ++++++++++
.../console/entity/base/BaseEntity.java | 38 ++++++
.../console/entity/client/ClientEntity.java | 95 +++++++++++++
.../entity/connection/ConnectionEntity.java | 108 +++++++++++++++
.../entity/connector/ConnectorEntity.java | 74 ++++++++++
.../console/entity/meta/MetaEntity.java | 70 ++++++++++
.../console/enums/KubernetesPodStatus.java | 36 +++++
.../dashboard/console/enums/StatusEnum.java | 31 +++++
.../console/mapper/client/ClientMapper.java | 59 ++++++++
.../mapper/connection/ConnectionMapper.java | 84 ++++++++++++
.../mapper/connector/ConnectorMapper.java | 82 +++++++++++
.../console/mapper/meta/MetaMapper.java | 50 +++++++
.../health/HealthCheckScheduler.java | 28 ++++
.../service/client/ClientDataService.java | 12 +-
.../connection/ConnectionDataService.java | 31 +++++
.../service/connection/ConnectionService.java | 50 +++++++
.../ConnectionDataServiceDatabaseImpl.java | 85 ++++++++++++
.../connector/ConnectorDataService.java | 25 ++++
.../src/main/resources/application-dev.yml | 7 +-
.../main/resources/eventmesh-dashboard.sql | 128 ++++++++++++++++++
.../src/test/resources/application-test.yml | 36 +++++
.../src/test/resources/connectiontest.sql | 29 ++++
.../EventMeshDashboardApplicationTest.java | 17 +++
pom.xml | 5 +
30 files changed, 1370 insertions(+), 15 deletions(-)
rename eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/{EventmeshConsoleApplication.java => EventMeshDashboardApplication.java} (80%)
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SchedulerConfig.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseEntity.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapper.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapper.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapper.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/scheduler/health/HealthCheckScheduler.java
rename eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/client/ClientDataService.java (84%)
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionDataService.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionService.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImpl.java
create mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java
create mode 100644 eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql
create mode 100644 eventmesh-dashboard-console/src/test/resources/application-test.yml
create mode 100644 eventmesh-dashboard-console/src/test/resources/connectiontest.sql
diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml
index f79bd00c..52255b0a 100644
--- a/eventmesh-dashboard-common/pom.xml
+++ b/eventmesh-dashboard-common/pom.xml
@@ -20,10 +20,6 @@
-
- junit
- junit
-
org.projectlombok
lombok
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
similarity index 80%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
index a048f24c..79fc03d8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
@@ -20,16 +20,18 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@SpringBootApplication
+@EnableScheduling
@ComponentScan({"org.apache.eventmesh.dashboard.service", "org.apache.eventmesh.dashboard.console"})
-public class EventmeshConsoleApplication {
+public class EventMeshDashboardApplication {
public static void main(String[] args) {
- SpringApplication.run(EventmeshConsoleApplication.class, args);
- log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName());
+ SpringApplication.run(EventMeshDashboardApplication.class, args);
+ log.info("{} Successfully booted.", EventMeshDashboardApplication.class.getSimpleName());
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SchedulerConfig.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SchedulerConfig.java
new file mode 100644
index 00000000..aba415a4
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SchedulerConfig.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.dashboard.console.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SchedulerConfig {
+
+ @Bean
+ public ThreadPoolTaskScheduler taskScheduler() {
+ ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
+ taskScheduler.setPoolSize(5);
+ return taskScheduler;
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
new file mode 100644
index 00000000..12d33c8b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
@@ -0,0 +1,42 @@
+/*
+ * 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.dashboard.console.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.info.License;
+
+@Configuration
+public class SpringDocConfig {
+
+ @Bean
+ public OpenAPI eventmeshDashboardConsoleOpenAPI() {
+ return new OpenAPI()
+ .info(new Info()
+ .title("Eventmesh Dashboard Console API")
+ .version("v1")
+ .license(new License()
+ .name("License: Apache 2.0")
+ .url("http://www.apache.org/licenses/LICENSE-2.0")
+ )
+ );
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java
new file mode 100644
index 00000000..e2107cbe
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java
@@ -0,0 +1,24 @@
+/*
+ * 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.dashboard.console.constant;
+
+public class ApiPrefix {
+ public static final String API_PREFIX = "/eventmesh-dashboard/";
+
+ public static final String API_V1_PREFIX = API_PREFIX + "v1/";
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java
new file mode 100644
index 00000000..72d407ed
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.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.dashboard.console.controller.connection;
+
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class ConnectionController {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
new file mode 100644
index 00000000..d4062a68
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
@@ -0,0 +1,69 @@
+/*
+ * 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.dashboard.console.dto;
+
+import java.io.Serializable;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+
+public class ConnectionResponse implements Serializable {
+
+ private static final long serialVersionUID = -7317308457824435889L;
+
+ @Schema(name = "id", description = "primary key of table connection")
+ private Long id;
+
+ @Schema(name = "sourceType", defaultValue = "connector", allowableValues = {"connector", "client"})
+ private String sourceType;
+
+ @Schema(name = "sourceId", description = "connectorId or clientId")
+ private Long sourceId;
+
+ @Schema(name = "sourceStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
+ private Integer sourceStatus;
+
+ // @Schema(name = "sourceConfigList", description = "source config list")
+ // private List sourceConfigList;
+
+ @Schema(name = "sinkType", defaultValue = "connector", allowableValues = {"connector", "client"})
+ private String sinkType;
+
+ @Schema(name = "sinkId", description = "connectorId or clientId")
+ private Long sinkId;
+
+ @Schema(name = "sinkStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
+ private Integer sinkStatus;
+
+ // @Schema(name = "sinkConfigList", description = "sink config list")
+ // private List sinkConfigList;
+
+ private Long runtimeId;
+
+ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
+ private Integer status;
+
+ @Schema(name = "topic", description = "related topic name from storage")
+ private String topic;
+
+ private Long groupId;
+
+ private String groupName;
+
+ private String description;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseEntity.java
new file mode 100644
index 00000000..14192fad
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseEntity.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.dashboard.console.entity.base;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import lombok.Data;
+
+@Data
+@Schema(name = "BaseEntity", description = "Base entity")
+public class BaseEntity implements Serializable {
+
+ private static final long serialVersionUID = -2697805837923579585L;
+
+ private Long clusterId;
+
+ protected Timestamp createTime;
+
+ protected Timestamp updateTime;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java
new file mode 100644
index 00000000..4da4dada
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java
@@ -0,0 +1,95 @@
+/*
+ * 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.dashboard.console.entity.client;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;
+import org.apache.eventmesh.dashboard.console.enums.StatusEnum;
+
+import java.sql.Timestamp;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ClientEntity extends BaseEntity {
+
+ private static final long serialVersionUID = 8204133370609215856L;
+
+ /**
+ * Primary key
+ */
+ @Schema(name = "id", description = "primary key")
+ private Long id;
+
+ private String name;
+
+ private String platform;
+
+ /**
+ * programing language of client
+ */
+ @Schema(name = "language", example = "java")
+ private String language;
+
+ /**
+ * process id
+ */
+ @Schema(name = "pid", description = "process id")
+ private Long pid;
+
+ private String host;
+
+ private Integer port;
+
+ /**
+ * protocol used to connect to runtime.
+ */
+ @Schema(name = "protocol", example = "http", allowableValues = {"http", "grpc", "tcp"})
+ private String protocol;
+
+ /**
+ * 0: not active, 1: active
+ * @see StatusEnum
+ */
+ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
+ private Integer status;
+
+ /**
+ * csv format config id list.
+ * Example value: 1,2,7
+ * This field is updated when the configuration is modified via the web API, but is not used during the configuration retrieval process.
+ */
+ private String configIds;
+
+ private String description;
+
+ /**
+ * The time when the client is terminated.
+ */
+ private Timestamp endTime;
+
+ public void setStatusEntity(StatusEnum status) {
+ this.status = status.getNumber();
+ }
+}
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java
new file mode 100644
index 00000000..d4d21c51
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java
@@ -0,0 +1,108 @@
+/*
+ * 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.dashboard.console.entity.connection;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;
+import org.apache.eventmesh.dashboard.console.enums.StatusEnum;
+
+import java.sql.Timestamp;
+import java.util.Objects;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import lombok.Data;
+
+
+/**
+ * A Connection is a link from a source to a sink.
+ */
+@Data
+public class ConnectionEntity extends BaseEntity {
+
+ private static final long serialVersionUID = 6565578252656944905L;
+
+ /**
+ * Primary key
+ */
+ @Schema(name = "id", description = "primary key")
+ private Long id;
+
+ /**
+ * The type of source. Possible values are "connector" or "client".
+ */
+ @Schema(name = "sourceType", defaultValue = "connector", allowableValues = {"connector", "client"})
+ private String sourceType;
+
+ /**
+ * The id of the source.
+ * It can be connectorId or clientId according to the sourceType.
+ */
+ @Schema(name = "sourceId", description = "connectorId or clientId")
+ private Long sourceId;
+
+ /**
+ * The type of sink. Possible values are "connector" or "client".
+ */
+ @Schema(name = "sinkType", defaultValue = "connector", allowableValues = {"connector", "client"})
+ private String sinkType;
+
+ /**
+ * The id of the sink.
+ * It can be connectorId or clientId according to the sinkType.
+ */
+ @Schema(name = "sinkId", description = "connectorId or clientId")
+ private Long sinkId;
+
+ private Long runtimeId;
+
+ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active")
+ private Integer status;
+
+ private String topic;
+
+ private Long groupId;
+
+ private Timestamp endTime;
+
+ private String description;
+
+ public void setStatusEnum(StatusEnum statusEnum) {
+ this.status = statusEnum.getNumber();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ConnectionEntity that = (ConnectionEntity) o;
+ return Objects.equals(sourceType, that.sourceType)
+ && Objects.equals(sourceId, that.sourceId)
+
+ && Objects.equals(sinkType, that.sinkType)
+ && Objects.equals(sinkId, that.sinkId)
+
+ && Objects.equals(runtimeId, that.runtimeId)
+ && Objects.equals(status, that.status)
+
+ && Objects.equals(description, that.description);
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java
new file mode 100644
index 00000000..1e7cb07d
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java
@@ -0,0 +1,74 @@
+/*
+ * 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.dashboard.console.entity.connector;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;
+import org.apache.eventmesh.dashboard.console.enums.KubernetesPodStatus;
+import org.apache.eventmesh.dashboard.console.enums.StatusEnum;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ConnectorEntity extends BaseEntity {
+
+ private static final long serialVersionUID = -8226303660232951326L;
+
+ @Schema(name = "id", description = "primary key")
+ private Long id;
+
+ private String name;
+
+ private String className;
+
+ private String type;
+
+ /**
+ * 0: not active, 1: active
+ *
+ * @see StatusEnum
+ */
+ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active")
+ private Integer status;
+
+ /**
+ * @see KubernetesPodStatus
+ */
+ @Schema(name = "podState", defaultValue = "0", allowableValues = {"0", "1", "2", "3", "4", "5",
+ "6"}, description = "0:Pending, 1:Running, 2:Succeeded, 3:Failed, 4:Unknown, 5:Terminating, 6:Terminated")
+ private Integer podState;
+
+ /**
+ * csv format config id list.
Example value: 1,2,7
This field is updated when the configuration is modified via the web API, but is not
+ * used during the configuration retrieval process.
+ */
+ private String configIds;
+
+ public void setStatusEnum(StatusEnum statusEnum) {
+ this.status = statusEnum.getNumber();
+ }
+
+ public void setKubernetesPodStatusEnum(KubernetesPodStatus kubernetesPodStatusEnum) {
+ this.podState = kubernetesPodStatusEnum.getNumber();
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java
new file mode 100644
index 00000000..2c32e284
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.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.dashboard.console.entity.meta;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;
+import org.apache.eventmesh.dashboard.console.enums.StatusEnum;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class MetaEntity extends BaseEntity {
+
+ private static final long serialVersionUID = 7176263169716424469L;
+
+ /**
+ * Primary key
+ */
+ @Schema(name = "id", description = "Primary key")
+ private Long id;
+
+ private String name;
+
+ private String type;
+
+ private String version;
+
+ private Long clusterId;
+
+ private String host;
+
+ private Integer port;
+
+ private String role;
+
+ private String username;
+
+ private String params;
+
+ /**
+ * 0: not active, 1: active
+ * @see StatusEnum
+ */
+ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active")
+ private Integer status;
+
+ public void setStatusEnum(StatusEnum statusEnum) {
+ this.status = statusEnum.getNumber();
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.java
new file mode 100644
index 00000000..4650316f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.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.dashboard.console.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum KubernetesPodStatus {
+ PENDING(0, "Pending"),
+ RUNNING(1, "Running"),
+ SUCCEEDED(2, "Succeeded"),
+ FAILED(3, "Failed"),
+ UNKNOWN(4, "Unknown"),
+ TERMINATING(5, "Terminating"),
+ TERMINATED(6, "Terminated");
+
+ private final Integer number;
+ private final String name;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java
new file mode 100644
index 00000000..271e3f2a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.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.dashboard.console.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum StatusEnum {
+ INACTIVE(0, "Inactive"),
+ ACTIVE(1, "Active");
+
+ private final Integer number;
+ private final String name;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapper.java
new file mode 100644
index 00000000..671bd81b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapper.java
@@ -0,0 +1,59 @@
+/*
+ * 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.dashboard.console.mapper.client;
+
+import org.apache.eventmesh.dashboard.console.entity.client.ClientEntity;
+
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+/**
+ * Mybatis Mapper for the table of client.
+ */
+@Mapper
+public interface ClientMapper {
+
+ @Select("SELECT * FROM `client` WHERE `id` = #{id}")
+ ClientEntity selectById(Long id);
+
+ @Select("SELECT * FROM `client` WHERE `cluster_id` = #{clusterId}")
+ ClientEntity selectByClusterId(Long clusterId);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert(
+ "INSERT INTO `client` (`cluster_id`, `name`, `platform`,"
+ + " `language`, `pid`, `host`, `port`, `protocol`,"
+ + " `status`, `config_ids`, `description`, `end_time`) "
+ + "VALUES (#{clusterId}, #{name}, #{platform},"
+ + " #{language}, #{pid}, #{host}, #{port}, #{protocol},"
+ + " #{status}, #{configIds}, #{description}, #{endTime})")
+ void insert(ClientEntity clientEntity);
+
+ @Update("UPDATE `client` SET status = #{status}, end_time = NOW() WHERE id = #{id}")
+ void deActive(ClientEntity clientEntity);
+
+ @Update("UPDATE `client` SET status = #{status} WHERE id = #{id}")
+ void updateStatus(ClientEntity clientEntity);
+
+ @Delete("DELETE FROM `client` WHERE id = #{id}")
+ void deleteById(Long id);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapper.java
new file mode 100644
index 00000000..af0a2acb
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapper.java
@@ -0,0 +1,84 @@
+/*
+ * 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.dashboard.console.mapper.connection;
+
+import org.apache.eventmesh.dashboard.console.entity.connection.ConnectionEntity;
+
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * Mybatis Mapper for the table of connection.
+ */
+@Mapper
+public interface ConnectionMapper {
+
+ @Select("SELECT * FROM connection WHERE id = #{id}")
+ ConnectionEntity selectById(ConnectionEntity connectionEntity);
+
+ @Select("SELECT * FROM connection")
+ List selectAll();
+
+ @Select("SELECT * FROM connection WHERE cluster_id = #{clusterId}")
+ List selectByClusterId(ConnectionEntity connectionEntity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("INSERT INTO connection (cluster_id, source_type, source_id,"
+ + " sink_type, sink_id, runtime_id, status, topic, group_id, description)"
+ + " VALUES ( #{clusterId}, #{sourceType}, #{sourceId}, "
+ + " #{sinkType}, #{sinkId}, #{runtimeId}, #{status}, #{topic}, #{groupId}, #{description})")
+ void insert(ConnectionEntity connectionEntity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("")
+ void batchInsert(List connectionEntityList);
+
+ @Update("UPDATE connection SET status = #{status}, end_time = NOW() WHERE id = #{id}")
+ void endConnectionById(ConnectionEntity connectionEntity);
+
+ @Delete("DELETE FROM connection WHERE cluster_id = #{clusterId}")
+ void deleteAllByClusterId(ConnectionEntity connectionEntity);
+
+ @Delete("DELETE FROM connection WHERE id = #{id}")
+ void deleteById(ConnectionEntity connectionEntity);
+
+ @Delete("")
+ void batchDelete(List connectionEntityList);
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
new file mode 100644
index 00000000..07913275
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
@@ -0,0 +1,82 @@
+/*
+ * 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.dashboard.console.mapper.connector;
+
+import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
+
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * Mybatis Mapper for the table of connector.
+ */
+@Mapper
+public interface ConnectorMapper {
+
+ @Select("SELECT * FROM connector WHERE id = #{id}")
+ ConnectorEntity selectById(ConnectorEntity connectorEntity);
+
+ @Select("SELECT * FROM connector WHERE cluster_id = #{clusterId}")
+ ConnectorEntity selectByClusterId(ConnectorEntity connectorEntity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("INSERT INTO connector (cluster_id, name, class_name, type, status, pod_state, config_ids) "
+ + "VALUES (#{connectClusterId}, #{name}, #{className}, #{type}, #{status}, #{podState}, #{configIds})")
+ void insert(ConnectorEntity connectorEntity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("")
+ void batchInsert(List connectorEntityList);
+
+ @Update("UPDATE connector SET status = #{status} WHERE id = #{id}")
+ void updateStatus(ConnectorEntity connectorEntity);
+
+ @Update("UPDATE connector SET pod_state = #{podState} WHERE id = #{id}")
+ void updatePodState(ConnectorEntity connectorEntity);
+
+ @Update("UPDATE connector SET config_ids = #{configIds} WHERE id = #{id}")
+ void updateConfigIds(ConnectorEntity connectorEntity);
+
+ @Delete("DELETE FROM connector WHERE id = #{id}")
+ void deleteById(ConnectorEntity connectorEntity);
+
+ @Delete("DELETE FROM connector WHERE cluster_id = #{clusterId}")
+ void deleteByClusterId(ConnectorEntity connectorEntity);
+
+ @Delete("")
+ void batchDelete(List connectorEntities);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapper.java
new file mode 100644
index 00000000..f22bf74a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapper.java
@@ -0,0 +1,50 @@
+/*
+ * 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.dashboard.console.mapper.meta;
+
+import org.apache.eventmesh.dashboard.console.entity.meta.MetaEntity;
+
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+/**
+ * Mybatis Mapper for the table of meta.
+ */
+@Mapper
+public interface MetaMapper {
+ @Select("SELECT * FROM meta WHERE id = #{id}")
+ MetaEntity selectById(MetaEntity metaEntity);
+
+ @Select("SELECT * FROM meta WHERE cluster_id = #{clusterId}")
+ MetaEntity selectByClusterId(MetaEntity metaEntity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("INSERT INTO meta (name, type, version, cluster_id, host, port, role, username, params, status)"
+ + " VALUES ( #{name}, #{type}, #{version}, #{clusterId}, #{host}, #{port}, #{role}, #{username}, #{params}, #{status})")
+ void insert(MetaEntity metaEntity);
+
+ @Update("UPDATE meta SET status = #{status} WHERE id = #{id}")
+ void update(MetaEntity metaEntity);
+
+ @Delete("DELETE FROM meta WHERE id = #{id}")
+ void deleteById(MetaEntity metaEntity);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/scheduler/health/HealthCheckScheduler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/scheduler/health/HealthCheckScheduler.java
new file mode 100644
index 00000000..7263f7cd
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/scheduler/health/HealthCheckScheduler.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.dashboard.console.scheduler.health;
+
+import org.springframework.stereotype.Component;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Component
+public class HealthCheckScheduler {
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/client/ClientDataService.java
similarity index 84%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/client/ClientDataService.java
index 673282d6..4daa5ff1 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/client/ClientDataService.java
@@ -15,9 +15,11 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common;
+package org.apache.eventmesh.dashboard.console.service.client;
-public class Main {
- public static void main(String[] args) {
- }
-}
\ No newline at end of file
+/**
+ * Service providing data of clients.
+ */
+public interface ClientDataService {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionDataService.java
new file mode 100644
index 00000000..05361eb2
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionDataService.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.dashboard.console.service.connection;
+
+import org.apache.eventmesh.dashboard.console.entity.connection.ConnectionEntity;
+
+import java.util.List;
+
+/**
+ * Service providing data of connections.
+ */
+public interface ConnectionDataService {
+ List getAllConnections();
+
+ void replaceAllConnections(List connectionEntityList);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionService.java
new file mode 100644
index 00000000..3faedd68
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/ConnectionService.java
@@ -0,0 +1,50 @@
+/*
+ * 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.dashboard.console.service.connection;
+
+import org.apache.eventmesh.dashboard.console.entity.connection.ConnectionEntity;
+import org.apache.eventmesh.dashboard.console.service.connection.impl.ConnectionDataServiceDatabaseImpl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Service
+public class ConnectionService {
+ @Autowired
+ ConnectionDataService metaConnectionService;
+
+ @Autowired
+ ConnectionDataServiceDatabaseImpl databaseConnectionService;
+
+ public void syncConnection() {
+ try {
+ List connectionEntityList = metaConnectionService.getAllConnections();
+ databaseConnectionService.replaceAllConnections(connectionEntityList);
+ } catch (Exception e) {
+ log.error("sync connection info from {} to {} failed for reason:{}.",
+ metaConnectionService.getClass().getSimpleName(),
+ databaseConnectionService.getClass().getSimpleName(),
+ e.getMessage());
+ }
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImpl.java
new file mode 100644
index 00000000..780ee990
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImpl.java
@@ -0,0 +1,85 @@
+/*
+ * 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.dashboard.console.service.connection.impl;
+
+import org.apache.eventmesh.dashboard.console.entity.connection.ConnectionEntity;
+import org.apache.eventmesh.dashboard.console.mapper.connection.ConnectionMapper;
+import org.apache.eventmesh.dashboard.console.service.connection.ConnectionDataService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Service
+public class ConnectionDataServiceDatabaseImpl implements ConnectionDataService {
+
+ @Autowired
+ private ConnectionMapper connectionMapper;
+
+ public List getAllConnectionsByClusterId(Long clusterId) {
+ ConnectionEntity connectionEntity = new ConnectionEntity();
+ connectionEntity.setClusterId(clusterId);
+ return connectionMapper.selectByClusterId(connectionEntity);
+ }
+
+
+ @Override
+ public List getAllConnections() {
+ return connectionMapper.selectAll();
+ }
+
+
+ @Override
+ @Transactional
+ public void replaceAllConnections(List connectionEntityList) {
+ Map> connectionsGroupedByClusterId = connectionEntityList.stream()
+ .collect(Collectors.groupingBy(ConnectionEntity::getClusterId));
+
+ connectionsGroupedByClusterId.forEach((clusterId, newConnections) -> {
+ ConnectionEntity connectionEntity = new ConnectionEntity();
+ connectionEntity.setClusterId(clusterId);
+ List existingConnections = connectionMapper.selectByClusterId(connectionEntity);
+
+ // Collect connections that are not in the new list
+ List connectionsToDelete = existingConnections.stream()
+ .filter(existingConnection -> !newConnections.contains(existingConnection))
+ .collect(Collectors.toList());
+
+ // Collect new connections that are not in the existing list
+ List connectionsToInsert = newConnections.stream()
+ .filter(connection -> !existingConnections.contains(connection))
+ .collect(Collectors.toList());
+
+ // Delete connections in batch
+ if (!connectionsToDelete.isEmpty()) {
+ connectionMapper.batchDelete(connectionsToDelete);
+ }
+
+ // Insert new connections in batch
+ if (!connectionsToInsert.isEmpty()) {
+ connectionMapper.batchInsert(connectionsToInsert);
+ }
+ });
+ }
+}
+
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java
new file mode 100644
index 00000000..b0b96427
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.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.dashboard.console.service.connector;
+
+/**
+ * Service providing data of connectors.
+ */
+public interface ConnectorDataService {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/resources/application-dev.yml b/eventmesh-dashboard-console/src/main/resources/application-dev.yml
index bfe02806..1c5e8400 100644
--- a/eventmesh-dashboard-console/src/main/resources/application-dev.yml
+++ b/eventmesh-dashboard-console/src/main/resources/application-dev.yml
@@ -17,8 +17,6 @@
server:
port: 9898
- servlet:
- context-path: "/eventmesh"
spring:
servlet:
@@ -46,6 +44,9 @@ spring:
test-while-idle: true
min-evictable-idle-time-millis: 300000
-
+# cron job config, use cron expression
+cron:
+ #health check job
+ health: "0/15 * * * * ? *"
diff --git a/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql b/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql
new file mode 100644
index 00000000..8de09e77
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+
+DROP TABLE IF EXISTS `client`;
+CREATE TABLE `client`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
+ `name` varchar(192) NOT NULL DEFAULT '' COMMENT '客户端名称',
+ `platform` varchar(192) NOT NULL DEFAULT '' COMMENT '客户端平台',
+ `language` varchar(192) NOT NULL DEFAULT '' COMMENT '客户端语言',
+ `pid` bigint(22) NOT NULL DEFAULT '-1' COMMENT '客户端进程ID',
+ `host` varchar(128) NOT NULL DEFAULT '' COMMENT '客户端地址',
+ `port` int(16) NOT NULL DEFAULT '-1' COMMENT '客户端端口',
+ `protocol` varchar(192) NOT NULL DEFAULT '' COMMENT '协议类型',
+ `status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '状态: 1启用,0未启用',
+ `config_ids` text NOT NULL DEFAULT '' COMMENT 'csv config id list, like:1,3,7',
+ `description` text NOT NULL DEFAULT '' COMMENT '客户端描述',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '结束时间',
+ `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+
+ PRIMARY KEY (`id`),
+ INDEX `idx_cluster_id` (`cluster_id`)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8 COMMENT ='客户端信息表';
+
+
+
+DROP TABLE IF EXISTS `connector`;
+CREATE TABLE `connector`
+(
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
+ `name` varchar(512) NOT NULL DEFAULT '' COMMENT 'Connector名称',
+ `class_name` varchar(512) NOT NULL DEFAULT '' COMMENT 'Connector类',
+ `type` varchar(32) NOT NULL DEFAULT '' COMMENT 'Connector类型',
+ `status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '状态: 1启用,0未启用',
+ `pod_state` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT 'k8s pod状态。0: pending;1: running;2: success;3: failed;4: unknown',
+ `config_ids` text NOT NULL DEFAULT '' COMMENT 'csv config id list, like:1,3,7',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ INDEX `idx_cluster_id` (`cluster_id`)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8 COMMENT ='Connector信息表';
+
+DROP TABLE IF EXISTS `connection`;
+CREATE TABLE `connection`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
+ `source_type` varchar(64) NOT NULL DEFAULT '' COMMENT 'source类型,可以为client或source connector',
+ `source_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'client或source connector ID',
+ `sink_type` varchar(64) NOT NULL DEFAULT '' COMMENT 'sink类型,可以为client或sink connector',
+ `sink_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'client或sink connector ID',
+ `runtime_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '对应runtime id',
+ `status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '状态: 1启用,0未启用',
+ `topic` varchar(192) NOT NULL DEFAULT '' COMMENT 'topic name',
+ `group_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'GroupID',
+ `description` text NOT NULL DEFAULT '' COMMENT '客户端描述',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '结束时间',
+ `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+
+ PRIMARY KEY (`id`),
+ INDEX `idx_cluster_id` (`cluster_id`),
+ INDEX `idx_group_id` (`group_id`),
+ INDEX `idx_topic` (`topic`),
+ INDEX `idx_source_id` (`source_id`),
+ INDEX `idx_sink_id` (`sink_id`)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8 COMMENT ='client和connector连接关系,这里的client包括runtime';
+
+DROP TABLE IF EXISTS `health_check_result`;
+CREATE TABLE `health_check_result`
+(
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `dimension` int(11) NOT NULL DEFAULT '0' COMMENT '检查维度(0:未知,1:Cluster,2:Runtime,3:Topic,4:Group)',
+ `config_name` varchar(192) NOT NULL DEFAULT '' COMMENT '配置名',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群ID',
+ `res_name` varchar(192) NOT NULL DEFAULT '' COMMENT '资源名称',
+ `passed` tinyint(4) NOT NULL DEFAULT '0' COMMENT '检查通过(0:未通过,1:通过)',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+ PRIMARY KEY (`id`),
+ INDEX `idx_cluster_id` (`cluster_id`),
+ UNIQUE KEY `uniq_dimension_config_cluster_res` (`dimension`, `config_name`, `cluster_id`, `res_name`)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8 COMMENT ='健康检查结果';
+
+DROP TABLE IF EXISTS `meta`;
+CREATE TABLE `meta`
+(
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `name` varchar(192) NOT NULL DEFAULT '' COMMENT '注册中心名称',
+ `type` varchar(192) NOT NULL DEFAULT '' COMMENT '注册中心类型,nacos,etcd,zookeeper',
+ `version` varchar(128) NOT NULL DEFAULT '' COMMENT '注册中心版本',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
+ `host` varchar(128) NOT NULL DEFAULT '' COMMENT '注册中心地址',
+ `port` int(16) NOT NULL DEFAULT '-1' COMMENT '注册中心端口',
+ `role` varchar(16) NOT NULL DEFAULT '-1' COMMENT '角色, leader follower observer',
+ `username` varchar(192) NOT NULL DEFAULT '' COMMENT '注册中心用户名',
+ `params` varchar(192) NOT NULL DEFAULT '' COMMENT '注册中心启动参数',
+ `status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '状态: 1启用,0未启用',
+
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+
+ PRIMARY KEY (`id`),
+ INDEX `idx_cluster_id` (`cluster_id`)
+
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8 COMMENT ='注册中心信息表';
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/test/resources/application-test.yml b/eventmesh-dashboard-console/src/test/resources/application-test.yml
new file mode 100644
index 00000000..1a903d3f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/test/resources/application-test.yml
@@ -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.
+#
+
+spring:
+ datasource:
+ name: eventmesh-console
+ type: com.alibaba.druid.pool.DruidDataSource
+ druid:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://localhost:3306/eventmesh-dashboard-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
+ username: root
+ password: root
+
+ initial-size: 1
+ max-active: 50
+ min-idle: 5
+ max-wait: 6000
+ validation-query: select 'x'
+ validation-query-timeout: 15
+ test-on-borrow: false
+ test-while-idle: true
+ min-evictable-idle-time-millis: 300000
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/test/resources/connectiontest.sql b/eventmesh-dashboard-console/src/test/resources/connectiontest.sql
new file mode 100644
index 00000000..641ea5fa
--- /dev/null
+++ b/eventmesh-dashboard-console/src/test/resources/connectiontest.sql
@@ -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.
+ */
+
+DELETE FROM `eventmesh-dashboard-test`.connection WHERE TRUE;
+ALTER TABLE `eventmesh-dashboard-test`.connection AUTO_INCREMENT = 1;
+
+insert into `eventmesh-dashboard-test`.connection (id, cluster_id, source_type, source_id, sink_type, sink_id, runtime_id, status, topic, group_id, description, create_time, end_time, update_time)
+values (1, 1, 'connector', 1, 'connector', 1, 1, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
+ (2, 1, 'connector', 2, 'connector', 2, 2, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
+ (3, 1, 'connector', 3, 'connector', 3, 3, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
+ (4, 2, 'connector', 1, 'connector', 1, 1, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
+ (5, 2, 'client', 5, 'client', 5, 5, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
+ (6, 3, 'client', 6, 'client', 6, 6, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11');
+
+
diff --git a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java
index 0007c1df..cde38a47 100644
--- a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java
+++ b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.dashboard.core;
import org.springframework.boot.test.context.SpringBootTest;
diff --git a/pom.xml b/pom.xml
index e8ac69c5..59cb1874 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,11 @@
mybatis-spring-boot-starter
${mybatis-spring-boot.version}
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter-test
+ ${mybatis-spring-boot.version}
+