1

I want to update the custom properties during application execution in Mule 3. e.g. property name is path Access the property ${path}. Any way to update the path variable dynamically using MEL or DataWeave1.0 or any alternate solution.

Mulesoft Developer
  • 2,664
  • 5
  • 28
  • 41

1 Answers1

2

The issue with properties is that they are resolved while the application is starting. You can change the value on the registry but the components that are already running will have the old value.

If they do not change too much, I recommend just changing them and restarting the app. It only takes some seconds.

If they change too frequently or you cannot stop the app for some reason, I recommend using some repository. It can be a DB or the internal Object Store. If you use the Object Store, you can use the properties to set the first default value and then create an HTTP endpoint to modify the values on it.

Once you retrieve the values, you can configure expressions instead of properties to use them in the Mule components.

Jorge Garcia
  • 1,313
  • 8
  • 14
  • When we add the generic database connector in Mule-3 and add/update the Driver Class Name dynamically, we are unable to write the MEL expression in that field and can assign the value with custom property or write the driver name. – Mulesoft Developer Jan 28 '20 at 05:50