Skip to content

Commit

Permalink
[ISSUE #4825] Deprecate Webhook function of EventMesh Runtime(v1) (#5153
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Pil0tXia authored Jan 7, 2025
1 parent 52a1bb1 commit ef16253
Show file tree
Hide file tree
Showing 72 changed files with 4 additions and 3,486 deletions.
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ tasks.register('dist') {
"eventmesh-spi",
"eventmesh-starter",
"eventmesh-storage-plugin:eventmesh-storage-api",
"eventmesh-trace-plugin:eventmesh-trace-api",
"eventmesh-webhook:eventmesh-webhook-api",
"eventmesh-webhook:eventmesh-webhook-admin",
"eventmesh-webhook:eventmesh-webhook-receive"]
"eventmesh-trace-plugin:eventmesh-trace-api"]
doLast {
includedProjects.each {
def subProject = findProject(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ public class CommonConfiguration {
@ConfigField(field = "server.provide.protocols", reload = true)
private List<String> eventMeshProvideServerProtocols;

@ConfigField(reload = true)
private String eventMeshWebhookOrigin;

@ConfigField(reload = true)
private String meshGroup;

Expand All @@ -122,7 +119,6 @@ public class CommonConfiguration {
private boolean eventMeshRegistryPluginEnabled = false;

public void reload() {
this.eventMeshWebhookOrigin = "eventmesh." + eventMeshIDC;

if (Strings.isNullOrEmpty(this.eventMeshServerIp)) {
this.eventMeshServerIp = IPUtils.getLocalAddress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,5 @@ public void testGetCommonConfiguration() {
Assertions.assertTrue(config.isEventMeshServerSecurityEnable());
Assertions.assertTrue(config.isEventMeshServerMetaStorageEnable());
Assertions.assertTrue(config.isEventMeshServerTraceEnable());

Assertions.assertEquals("eventmesh.idc-succeed!!!", config.getEventMeshWebhookOrigin());
}
}
22 changes: 0 additions & 22 deletions eventmesh-protocol-plugin/eventmesh-protocol-webhook/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions eventmesh-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,13 @@ dependencies {
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-meshmessage")
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-openmessage")
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-http")
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-webhook")

implementation project(":eventmesh-metrics-plugin:eventmesh-metrics-api")
implementation project(":eventmesh-metrics-plugin:eventmesh-metrics-prometheus")

implementation project(":eventmesh-trace-plugin:eventmesh-trace-api")
implementation project(":eventmesh-trace-plugin:eventmesh-trace-zipkin")

implementation project(":eventmesh-webhook:eventmesh-webhook-admin")
implementation project(":eventmesh-webhook:eventmesh-webhook-api")
implementation project(":eventmesh-webhook:eventmesh-webhook-receive")

implementation project(":eventmesh-retry:eventmesh-retry-api")

testImplementation "org.mockito:mockito-inline"
Expand Down
15 changes: 1 addition & 14 deletions eventmesh-runtime/conf/eventmesh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,4 @@ eventMesh.metrics.plugin=prometheus

# trace plugin
eventMesh.server.trace.enabled=false
eventMesh.trace.plugin=zipkin

# webhook
# Start webhook admin service
eventMesh.webHook.admin.start=true
# Webhook event configuration storage mode. Currently, only file and nacos are supported
eventMesh.webHook.operationMode=file
# The file storage path of the file storage mode. If #{eventMeshHome} is written, it is in the EventMesh root directory
eventMesh.webHook.fileMode.filePath= #{eventMeshHome}/webhook
# Nacos storage mode, and the configuration naming rule is EventMesh webHook. nacosMode. {nacos native configuration key} please see the specific configuration [nacos github api](https://github.com/alibaba/nacos/blob/develop/api/src/main/java/com/alibaba/nacos/api/SystemPropertyKeyConst.java)
## Address of Nacos
eventMesh.webHook.nacosMode.serverAddr=127.0.0.1:8848
# Webhook CloudEvent sending mode. This property is the same as the eventMesh.storage.plugin.type configuration.
eventMesh.webHook.producer.storage=standalone
eventMesh.trace.plugin=zipkin
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@
package org.apache.eventmesh.runtime.admin.handler;

import org.apache.eventmesh.runtime.admin.handler.v1.ConfigurationHandlerV1;
import org.apache.eventmesh.runtime.admin.handler.v1.DeleteWebHookConfigHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.EventHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.GrpcClientHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.HTTPClientHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.InsertWebHookConfigHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.MetaHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.QueryRecommendEventMeshHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.QueryWebHookConfigByIdHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.QueryWebHookConfigByManufacturerHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.RedirectClientByIpPortHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.RedirectClientByPathHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.RedirectClientBySubSystemHandler;
Expand All @@ -38,19 +34,15 @@
import org.apache.eventmesh.runtime.admin.handler.v1.ShowListenClientByTopicHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.TCPClientHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.TopicHandler;
import org.apache.eventmesh.runtime.admin.handler.v1.UpdateWebHookConfigHandler;
import org.apache.eventmesh.runtime.admin.handler.v2.ConfigurationHandler;
import org.apache.eventmesh.runtime.boot.EventMeshGrpcServer;
import org.apache.eventmesh.runtime.boot.EventMeshHTTPServer;
import org.apache.eventmesh.runtime.boot.EventMeshServer;
import org.apache.eventmesh.runtime.boot.EventMeshTCPServer;
import org.apache.eventmesh.runtime.common.EventMeshHttpHandler;
import org.apache.eventmesh.runtime.meta.MetaStorage;
import org.apache.eventmesh.webhook.admin.AdminWebHookConfigOperationManager;
import org.apache.eventmesh.webhook.api.WebHookConfigOperation;

import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;

Expand All @@ -67,8 +59,6 @@ public class AdminHandlerManager {

private MetaStorage eventMeshMetaStorage;

private AdminWebHookConfigOperationManager adminWebHookConfigOperationManage;

private final Map<String, HttpHandler> httpHandlerMap = new ConcurrentHashMap<>();

public AdminHandlerManager(EventMeshServer eventMeshServer) {
Expand All @@ -77,7 +67,6 @@ public AdminHandlerManager(EventMeshServer eventMeshServer) {
this.eventMeshGrpcServer = eventMeshServer.getEventMeshGrpcServer();
this.eventMeshHTTPServer = eventMeshServer.getEventMeshHTTPServer();
this.eventMeshMetaStorage = eventMeshServer.getMetaStorage();
this.adminWebHookConfigOperationManage = eventMeshTCPServer.getAdminWebHookConfigOperationManage();
}

public void registerHttpHandler() {
Expand All @@ -102,14 +91,6 @@ public void registerHttpHandler() {
initHandler(new TopicHandler(eventMeshTCPServer.getEventMeshTCPConfiguration().getEventMeshStoragePluginType()));
initHandler(new EventHandler(eventMeshTCPServer.getEventMeshTCPConfiguration().getEventMeshStoragePluginType()));
initHandler(new MetaHandler(eventMeshMetaStorage));
if (Objects.nonNull(adminWebHookConfigOperationManage.getWebHookConfigOperation())) {
WebHookConfigOperation webHookConfigOperation = adminWebHookConfigOperationManage.getWebHookConfigOperation();
initHandler(new InsertWebHookConfigHandler(webHookConfigOperation));
initHandler(new UpdateWebHookConfigHandler(webHookConfigOperation));
initHandler(new DeleteWebHookConfigHandler(webHookConfigOperation));
initHandler(new QueryWebHookConfigByIdHandler(webHookConfigOperation));
initHandler(new QueryWebHookConfigByManufacturerHandler(webHookConfigOperation));
}

// v2 endpoints
initHandler(new ConfigurationHandler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ protected void get(HttpRequest httpRequest, ChannelHandlerContext ctx) throws Ex
eventMeshTCPConfiguration.getEventMeshCluster(),
eventMeshTCPConfiguration.getEventMeshServerIp(),
eventMeshTCPConfiguration.getEventMeshName(),
eventMeshTCPConfiguration.getEventMeshWebhookOrigin(),
eventMeshTCPConfiguration.isEventMeshServerSecurityEnable(),
eventMeshTCPConfiguration.isEventMeshServerMetaStorageEnable(),
// TCP Configuration
Expand Down

This file was deleted.

Loading

0 comments on commit ef16253

Please sign in to comment.