Updating component instance configuration at runtime
Right now, the entire system is practically unfinished and unusable.
The API component doesn't offer any flexibility whatsoever and gives no feedback for what happened.
The only existing message is the cfgDaemon_Component
API message, which doesn't communicate to anyone that it edits component instance configuration. The handler method for this API message updates runtime configuration and calls modify on the given component instance. The configuration could be saved, but currently it's hard-coded to not update component instance configuration persistently.
Ideas of improvement and requirements if we wanted to be able to edit Daemon configuration at runtime without having to restart the service whenever we change one parameter:
- Ensure that all components initialize their member variables from configuration in the
modify
method, so that this works uniformly across Daemon. - If a component instance configuration is modified, we also have to make sure that all relevant and already running features and processes are updated if possible, or straight up re-initialized within the component (e.g. changing
JsonSplitter
instance ID works, because the instance ID is always read and assigned from component members, however connections to MQTT broker would not work as expected, client is already connected, so it would start publishing messages to new topics, but at the old broker). - Update API to allow for more granular operation, things like Get configuration and Set configuration. Get should return current configuration, Set should return configuration after modifications.
- Improve
JsonCfgApi
error handling to account for various error cases that may occur along the way. - Extend shape's
ConfigurationManager
Edited by Karel Hanák