exceptionfactory opened a new pull request, #9192: URL: https://github.com/apache/nifi/pull/9192
# Summary [NIFI-13665](https://issues.apache.org/jira/browse/NIFI-13665) Refactors the NiFi Bootstrap and Runtime process handling components in `nifi-bootstrap` and `nifi-runtime` for streamlined start and status operations. The `nifi-bootstrap` module includes a new main class `BootstrapProcess` that replaces the `RunNiFi` class. The `BootstrapProcess` class delegates argument parsing and requests instances of the `BootstrapCommand` interface, which extends `java.lang.Runnable` and provides a `CommandStatus` with exit code for each command. The `nifi-runtime` module includes a new `ManagementServer` interface and `StandardManagementServer` implementation based on the standard Java [HttpServer](https://docs.oracle.com/en/java/javase/21/docs/api/jdk.httpserver/com/sun/net/httpserver/HttpServer.html). The `HttpServer` implementation replaces the custom TCP socket protocol implementation and provides the same set of status and diagnostics methods over an HTTP server running on the localhost address. The default configuration starts the Management Server on `127.0.0.1:52020` and also selects an alternative port when the default port is already bound. The HTTP Management Server in `nifi-runtime` supports status and control commands from `nifi-bootstrap` using the standard Java [HttpClient](https://docs.oracle.com/en/java/javase/21/docs/api/java.net.http/java/net/http/HttpClient.html) class. The `nifi-bootstrap` module makes use of the Java [ProcessHandle](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ProcessHandle.html) abstraction to check for the status of existing application processes. The `ProcessHandle` implementation provides access to command arguments on Linux and macOS supporting commands enumerated in `nifi.sh`. The `ProcessHandle` implementation on Windows does not return command arguments, so the `nifi.cmd start` command uses child process monitoring to watch the application process status. This strategy avoids the need for creating and maintaining a process identifier file in a separate run directory. The `nifi.sh run` command keeps the application process in the foreground without the need for the bootstrap process. Other changes include removing `dump` and `env` commands as duplicative of the `diagnostics` command. The `nifi-system-test-suite` uses the new process building abstractions for direct control over application processes instead of mediation through the `RunNiFi` class. # Tracking Please complete the following tracking steps prior to pull request creation. ### Issue Tracking - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created ### Pull Request Tracking - [X] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000` - [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000` ### Pull Request Formatting - [X] Pull Request based on current revision of the `main` branch - [X] Pull Request refers to a feature branch with one commit containing changes # Verification Please indicate the verification steps performed prior to pull request creation. ### Build - [X] Build completed using `mvn clean install -P contrib-check` - [X] JDK 21 ### Licensing - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html) - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files ### Documentation - [ ] Documentation formatting appears as expected in rendered files -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
