Skip to content

It is not possible to keep manually added properties and update existing ones. #462

@ca-stefan-cordes

Description

@ca-stefan-cordes

The configuration of mule-maven-plugin allows to set false
which is fine for keeping manually added properties like

secure.properties.key=..........

when re-deploying a new application.
see /mule-deployer/src/main/java/org/mule/tools/deployment/cloudhub/CloudHubArtifactDeployer.java => resolveProperties(..)

But when setting overrideProperties to false all properties which already exist in the worker are kept.
Due to that e.g. changing <org.mule.runtime.core.api.processor.strategy.AsyncProcessingStrategyFactory.DEFAULT_MAX_CONCURRENCY>16</org.mule.runtime.core.api.processor.strategy.AsyncProcessingStrategyFactory.DEFAULT_MAX_CONCURRENCY>
to
<org.mule.runtime.core.api.processor.strategy.AsyncProcessingStrategyFactory.DEFAULT_MAX_CONCURRENCY>32</org.mule.runtime.core.api.processor.strategy.AsyncProcessingStrategyFactory.DEFAULT_MAX_CONCURRENCY>
in the pom.xml does not have any effect because the original value 16 is taken in resolveProperties(...)

So we need to deploy with overrideProperties=true to get the updated MAX_CONCURRENCY but then worker is not starting
because secure.properties.key is missing. It needs to be added manually again (which makes automatic deployment useless).

As there are several solutions to solve this I first want to start discussion before creating a pull request.

Solution 1: Just keep manually added

  • take entries of originalApplication.getProperties() for those ones not in deployment.getProperties()

Solution 2: Specify property names to be kept

  • Add a List to configuration instead of overrideProperties:
    <keepPropertyNames><keepPropertyName></keepPropertyName></keepPropertyNames>
    where all properties are specyfied which sould be taken from originalApplication.getProperties().
    In our case: <keepPropertyName>secure.properties.key</keepPropertyName>

Solution 3: Specify property names to override always

  • Add a List to configuration instead of overrideProperties:
    <forceOverwritePropertyNames><forceOverwritePropertyName></forceOverwritePropertyName></forceOverwritePropertyNames>
    In our case: <forceOverwritePropertyName>org.mule.runtime.core.api.processor.strategy.AsyncProcessingStrategyFactory.DEFAULT_MAX_CONCURRENCY</forceOverwritePropertyName>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions