hgaol opened a new pull request #2572: URL: https://github.com/apache/incubator-dolphinscheduler/pull/2572
## What is the purpose of the pull request Add plugin management ability for Alert service. With it, user can only depend the `dolphinscheduler-plugin-api` package, and implement `AlertPlugin` and `AlertPluginProvider`, and provide a resource file with name of the implement class for `AlertPluginProvider`. Which use Java [SPI](https://docs.oracle.com/javase/tutorial/ext/basics/spi.html#limitations-of-the-service-loader-api) feature. Here already give some utilities class to help developer to implement their own plugin. i.e. `PropertyUtils`, which read the configuration file named `plugin.properties`, and developer can get properties using this class. Developers do not need to involve log dependencies, just use `slf4j` to create the `Logger`, which included in the `dolphinscheduler-plugin-api` package. Currently I just keep same with the original email and enterprise wechat, and there are no different plugin for different alert handler logic. It also need collaborate with front-end engineer and may a long way to go. Also, I keep the original email and enterprise wechat just in alert module source code, I think the frequently used plugin should keep in the source code. I also plan to implement the default webhook plugin. :) ## Brief change log - Added `dolphinscheduler-plugin-api` module for developers to implement their own alert plugin. - Added some classes such as `PluginClassLoader`, `PluginManager` and its implementation class `FilePluginManager` in `dolphinscheduler-common` module under the `plugin` package. - Updated the `dolphinscheduler-alert` module with the plugin way, and added some tests. ## Verify this pull request - *Added some tests in `dolphinscheduler-plugin-api` and `dolphinscheduler-alert` packages*. - *Updated some tests in `dolphinscheduler-alert`*. - *Tested email function, and didn't test enterprise wechat, cause I don't have the environments. If anyone can do that, it's very appreciate.* ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
