From 30d75f21856ec86a41db914a3c21d7606effdab0 Mon Sep 17 00:00:00 2001 From: zhuangchong Date: Fri, 23 Oct 2020 09:55:27 +0800 Subject: [PATCH] the alert module support service. --- dolphinscheduler-alert/pom.xml | 4 ++++ .../java/org/apache/dolphinscheduler/alert/AlertServer.java | 4 +++- .../java/org/apache/dolphinscheduler/common/Constants.java | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-alert/pom.xml b/dolphinscheduler-alert/pom.xml index abae84515a..ebea0e8716 100644 --- a/dolphinscheduler-alert/pom.xml +++ b/dolphinscheduler-alert/pom.xml @@ -39,6 +39,10 @@ org.apache.dolphinscheduler dolphinscheduler-remote + + org.apache.dolphinscheduler + dolphinscheduler-common + junit junit diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java index 45184f03a4..41e76b370b 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java @@ -17,6 +17,8 @@ package org.apache.dolphinscheduler.alert; +import static org.apache.dolphinscheduler.common.Constants.ALERT_RPC_PORT; + import org.apache.dolphinscheduler.alert.plugin.AlertPluginManager; import org.apache.dolphinscheduler.alert.plugin.DolphinPluginLoader; import org.apache.dolphinscheduler.alert.plugin.DolphinPluginManagerConfig; @@ -110,7 +112,7 @@ public class AlertServer { */ private void initRemoteServer() { NettyServerConfig serverConfig = new NettyServerConfig(); - serverConfig.setListenPort(50501); + serverConfig.setListenPort(ALERT_RPC_PORT); this.server = new NettyRemotingServer(serverConfig); this.server.registerProcessor(CommandType.ALERT_SEND_REQUEST, new AlertRequestProcessor(alertDao, alertPluginManager, pluginDao)); this.server.start(); diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java index a8d04ced46..5c0ae1d638 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java @@ -387,13 +387,17 @@ public final class Constants { */ public static final int SEC_2_MINUTES_TIME_UNIT = 60; - /*** * * rpc port */ public static final int RPC_PORT = 50051; + /*** + * alert rpc port + */ + public static final int ALERT_RPC_PORT = 50052; + /** * forbid running task */