Skip to content

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
./toro-martini run -D hello=world

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
./toro-martini run -D hello=world -D property=value

2. Modifying the Startup Script

Alternatively, you can modify the startup script located at:

1
<martini-home>/bin/toro-martini

You can modify it using different text editors like nano or vim:

1
2
3
nano <martini-home>/bin/toro-martini

vim <martini-home>/bin/toro-martini

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
-Dmr_server.http.port=9090 

Overriding Package Properties:

1
2
3
-Dmr_crm.api.url=https://prod-salesforce.example.com
-Dmr_crm.max.retry.attempts=5
-Dmr_notification.email.sender=noreply@company.com

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.properties files in your packages under <package-name>/configuration/properties/

Via API: Send a request to the API explorer:

1
curl -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, and package.properties files.