Martini System Properties
System properties are configuration settings that are set at the startup of the Martini Server Runtime. These properties can influence the behavior of the server and its components, allowing you to customize the runtime environment according to your requirements.
Setting System Properties
System properties can be defined in two primary ways:
1. Startup Parameters
You can specify system properties directly as startup parameters when launching the Martini Server Runtime. This is done using the -D flag followed by the property key and value. For example:
1 | |
In this example, the system property hello is set to world. You can define multiple properties by repeating the -D flag for each one:
1 | |
2. Modifying the Startup Script
Alternatively, you can modify the startup script located at:
1 | |
You can modify it using different text editors like nano or vim:
1 2 3 | |
By adding your desired system properties within the script, you can ensure that they are set each time the server is started. This approach is useful for persistent configurations that you want to apply automatically.
Overriding Application and Package Properties via System Properties
System properties can also be used to override both application properties and package properties at runtime using a special mr_ prefix. This provides a powerful way to modify Martini's existing configuration without editing the configuration files directly.
Important: The
mr_prefix is used exclusively for overriding existing application and package properties. You cannot use this mechanism to add new properties that don't already exist in the respective configurations.
How It Works
- Property Name: Use
mr_prefix for system properties, followed by the actual property name - Detection: Martini automatically detects these prefixed properties at startup
- Processing: The prefix is removed and the property value is used to override the existing application or package property
- Priority: These runtime overrides take precedence over properties defined in the files
Example
Here are practical examples of overriding properties at runtime:
Overriding Application Properties:
1 | |
Overriding Package Properties:
1 2 3 | |
Martini will detect the prefixed properties and apply the overrides to the respective configurations, taking precedence over any existing values from the configuration files.
Tip: To see available properties you can override:
For Application Properties in Martini Designer: Navigate to Martini menu bar → Edit Properties
For Package Properties: Check the
package.propertiesfiles in your packages under<package-name>/configuration/properties/Via API: Send a request to the API explorer:
1curl -X GET "http://<martini-host-url>/esbapi/properties" -H "accept: application/json"
This approach is particularly useful for:
- Development environments where frequent configuration changes are needed
- Containerized deployments where configuration should be externalized
- CI/CD pipelines where different environments require different settings
- Testing scenarios where temporary configuration overrides are required
Note: System property overrides take precedence over values defined in
application.properties,override.properties, andpackage.propertiesfiles.