Skip to content

Commit f9a122a

Browse files
committed
Refactor: Integrate V2 capabilities into V1 core and remove redundant V2 runtime components
1 parent 7b90624 commit f9a122a

25 files changed

+16
-2390
lines changed

eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/Runtime.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/RuntimeFactory.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/RuntimeInstanceConfig.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/EventMeshStartup.java

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
package org.apache.eventmesh.runtime.boot;
1919

2020
import org.apache.eventmesh.common.config.ConfigService;
21-
import org.apache.eventmesh.common.enums.ComponentType;
22-
import org.apache.eventmesh.runtime.RuntimeInstanceConfig;
2321
import org.apache.eventmesh.runtime.constants.EventMeshConstants;
2422
import org.apache.eventmesh.runtime.util.BannerUtil;
2523

@@ -38,53 +36,25 @@ public static void main(String[] args) throws Exception {
3836

3937
BannerUtil.generateBanner();
4038

41-
RuntimeInstanceConfig runtimeInstanceConfig = null;
42-
try {
43-
runtimeInstanceConfig = ConfigService.getInstance().buildConfigInstance(RuntimeInstanceConfig.class);
44-
} catch (Exception e) {
45-
log.warn("Failed to load RuntimeInstanceConfig, falling back to legacy EventMeshServer mode", e);
46-
}
47-
48-
if (runtimeInstanceConfig != null && runtimeInstanceConfig.getComponentType() != null
49-
&& runtimeInstanceConfig.getComponentType() != ComponentType.MESH) {
50-
// V2 Runtime (Connector or Function)
51-
RuntimeInstance runtimeInstance = new RuntimeInstance(runtimeInstanceConfig);
52-
runtimeInstance.init();
53-
runtimeInstance.start();
54-
55-
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
56-
try {
57-
log.info("runtime shutting down hook begin.");
58-
long start = System.currentTimeMillis();
59-
runtimeInstance.shutdown();
60-
long end = System.currentTimeMillis();
61-
log.info("runtime shutdown cost {}ms", end - start);
62-
} catch (Exception e) {
63-
log.error("exception when shutdown.", e);
64-
}
65-
}));
66-
} else {
67-
// Legacy EventMeshServer (Mesh)
68-
EventMeshServer server = new EventMeshServer();
69-
server.init();
70-
server.start();
71-
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
72-
try {
73-
log.info("eventMesh shutting down hook begin.");
74-
long start = System.currentTimeMillis();
75-
server.shutdown();
76-
long end = System.currentTimeMillis();
77-
78-
log.info("eventMesh shutdown cost {}ms", end - start);
79-
} catch (Exception e) {
80-
log.error("exception when shutdown.", e);
81-
}
82-
}));
83-
}
39+
EventMeshServer server = new EventMeshServer();
40+
server.init();
41+
server.start();
42+
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
43+
try {
44+
log.info("eventMesh shutting down hook begin.");
45+
long start = System.currentTimeMillis();
46+
server.shutdown();
47+
long end = System.currentTimeMillis();
48+
49+
log.info("eventMesh shutdown cost {}ms", end - start);
50+
} catch (Exception e) {
51+
log.error("exception when shutdown.", e);
52+
}
53+
}));
8454
} catch (Throwable e) {
8555
log.error("EventMesh start fail.", e);
8656
System.exit(-1);
8757
}
8858

8959
}
90-
}
60+
}

eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/RuntimeInstance.java

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)