Browse Source

the alert module support service.

pull/3/MERGE
zhuangchong 4 years ago
parent
commit
30d75f2185
  1. 4
      dolphinscheduler-alert/pom.xml
  2. 4
      dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
  3. 6
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java

4
dolphinscheduler-alert/pom.xml

@ -39,6 +39,10 @@
<groupId>org.apache.dolphinscheduler</groupId> <groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-remote</artifactId> <artifactId>dolphinscheduler-remote</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-common</artifactId>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>

4
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java

@ -17,6 +17,8 @@
package org.apache.dolphinscheduler.alert; 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.AlertPluginManager;
import org.apache.dolphinscheduler.alert.plugin.DolphinPluginLoader; import org.apache.dolphinscheduler.alert.plugin.DolphinPluginLoader;
import org.apache.dolphinscheduler.alert.plugin.DolphinPluginManagerConfig; import org.apache.dolphinscheduler.alert.plugin.DolphinPluginManagerConfig;
@ -110,7 +112,7 @@ public class AlertServer {
*/ */
private void initRemoteServer() { private void initRemoteServer() {
NettyServerConfig serverConfig = new NettyServerConfig(); NettyServerConfig serverConfig = new NettyServerConfig();
serverConfig.setListenPort(50501); serverConfig.setListenPort(ALERT_RPC_PORT);
this.server = new NettyRemotingServer(serverConfig); this.server = new NettyRemotingServer(serverConfig);
this.server.registerProcessor(CommandType.ALERT_SEND_REQUEST, new AlertRequestProcessor(alertDao, alertPluginManager, pluginDao)); this.server.registerProcessor(CommandType.ALERT_SEND_REQUEST, new AlertRequestProcessor(alertDao, alertPluginManager, pluginDao));
this.server.start(); this.server.start();

6
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; public static final int SEC_2_MINUTES_TIME_UNIT = 60;
/*** /***
* *
* rpc port * rpc port
*/ */
public static final int RPC_PORT = 50051; public static final int RPC_PORT = 50051;
/***
* alert rpc port
*/
public static final int ALERT_RPC_PORT = 50052;
/** /**
* forbid running task * forbid running task
*/ */

Loading…
Cancel
Save