smolnar82 opened a new pull request, #1235: URL: https://github.com/apache/knox/pull/1235
[KNOX-1234](https://issues.apache.org/jira/browse/KNOX-3327) - Support periodic refresh of gateway configuration ## What changes were proposed in this pull request? This PR introduces the ability for the Knox Gateway to periodically refresh its configuration from a specific reloadable file (gateway-reloadable.xml). This allows administrators to modify certain gateway-level configurations at runtime without restarting the entire Gateway process. Key changes include: - Configuration Inclusion: Updated `GatewayConfigImpl` to include `gateway-reloadable.xml `in the prioritized list of configuration files. - Refresh Interval: Introduced` gateway.config.refresh.interval `(defaulting to 10,000ms) to control how often the gateway checks for updates. - Background Monitor: Added a scheduled executor in GatewayServer that monitors the modification timestamp of the reloadable configuration file and triggers a configuration reload if changes are detected. - SPI Updates: Added getConfigRefreshInterval() to the GatewayConfig interface. ## How was this patch tested? The patch was tested using new and updated automated unit tests: 1. `GatewayConfigImplTest.testGetConfigRefreshInterval`: Verified that the refresh interval configuration is correctly parsed. 2. `GatewayConfigImplTest.testReloadableConfigLoading`: Verified that properties defined in `gateway-reloadable.xml` are correctly loaded into the configuration object upon initialization. 3. `GatewayServerTest.testRefreshGatewayConfig`: Verified the logic that monitors file timestamps. Confirmed that: - An initial reload is triggered on first check. - Subsequent checks do not trigger a reload if the file hasn't changed. - Updating the file modification time correctly triggers a new reload. Steps to run tests: `mvn test -Dtest=GatewayConfigImplTest,GatewayServerTest -pl gateway-server` ## Integration Tests Unit tests were added to gateway-server to cover the new functionality. These tests use TemporaryFolder and manual XML generation to simulate file system changes and verify the reload behavior. ## UI changes N/A -- 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]
