Project: springxd
Issue XD-1577: Changing externalized module config properties at runtime
Once the container starts up and the module is deployed, the externalized module configuration properties could not be changed for the subsequent modules of same type. Here is the scenario for a stream "http | transform | log", with XD_MODULE_CONFIG_LOCATION and XD_MODULE_CONFIG_NAME using their default values. In, ${xd.config.home}/modules/modules.yml, I have: processor: transform: expression: "'Inside modules.yml'" and, in, ${xd.config.home}/modules/processor/transform/transform.properties, I have: expression: "'First module: inside transform.properties'" Now, I deploy this stream: "http | transform | log". Lets say, I have another stream that uses the transform module, but this time I want to change the expression in ${xd.config.home}/modules/processor/transform/transform.properties to, expression: "'Second module'" Now, when the stream containing this transform module gets deployed, it uses the same transform.properties that is used by the previously deployed transform module. What I understand from this behavior is that, the EnvironmentAwareModuleOptionsMetadataResolver caches the module environments for a given module type and name. When the same module is deployed from a given stream again, it uses the stored module environment and doesn't refresh/load the property sources from the module config locations mentioned above. Though this is good in one way that same module environment is re-used, changing the externalized module config properties would have no affect after the first module of same type/name is deployed. Though the EnvironmentAwareModuleOptionsMetadataResolver is used by both admin and container, this JIRA focuses more on the container side. There is one valid point with the current behavior where the module environment is cached and won't change. But is this by design?
Story points: 4