Runtime Customization
Introduction
You can use custom server settings to configure Mendix Runtime beyond the standard possibilities offered by Studio Pro.
com.mendix.core.isClusterSlave). If you do not, Mendix Runtime may behave incorrectly.
Each custom setting consists of a name and a value. For example, to set the hash algorithm to BCRYPT you add a custom setting with name HashAlgorithm and value BCRYPT. For a more detailed list of settings and example values, consult full-documented-m2ee.yaml.
If you are running your app on Mendix Cloud or SAP Business Technology Platform, you can access these settings by opening your app in Projects and choosing Environments > Environment Details > Runtime > Custom Runtime Settings. For more information see:
- the Runtime Tab section of Environment Details for information about Mendix Cloud
- the Runtime tab section of Environment Details on SAP BTP for information about the SAP BTP
When you are running your app locally, you can set these values in a Configuration.
There is more information on how this is done in the Cloud Foundry buildpack in Custom Runtime Settings in the GitHub repo.
For Docker-based deployments, runtime configurations are set using environment variables as explained in the GitHub repo
For Windows-based deployments, runtime configurations are set from the Mendix Service Console under Configuration > Advanced Settings > Custom Mendix settings.
Duration/Interval Settings
Durations and intervals can be specified in the following formats:
- ISO 8601 Periods, such as
P7D,PT1H30M, orPT1S(See https://en.wikipedia.org/wiki/ISO_8601#Durations for more information) - HOCON durations, such as
7 days,90m, or1 second(See https://github.com/lightbend/config/blob/main/HOCON.md#duration-format for more information)
General Settings
The following custom settings can be configured:
ApplicationRootUrl
The ApplicationRootUrl setting is used to specify the protocol, domain, and path to your application. This can be used within Java actions to get the public location of the application, for example when including a URL to the application when sending emails from a scheduled event.
ApplicationRootUrl setting must include the protocol and the path. So the the ApplicationRootUrl for the root of domain domain.example.com would be https://domain.example.com/
There are two main ways that you might use to host multiple applications.
- Routing based on a (sub)domain
- Routing based on a subpath
Say we are hosting two apps: App1 and App2. In domain-based routing, every app gets its own domain (for example. app1.domain.com and app2.domain.com). In subpath-based routing, this would be on a subpath, for example domain.com/app1 and domain.com/app2.
When setting up either routing variant, most content is correctly served automatically as it is relative to the path in which it is being served. Exceptions to this include:
- Client components that automatically forward/route you to a top-level domain
- Content that specifies a full path to your public domain/path
For the first case, domain-based routing is generally more stable, although path-based routing is also possible.
Examples of the second case are OData contracts, sending mails to your organization, and any place you want to render a static URL in your application. For this case it is possible to specify the ApplicationRootUrl.
Multiple External Domains
Mendix systems like OData that generate content based on a http request to the server, will use the headers passed (for example, by a proxy) to generate content. These headers are X-Forwarded-Proto, X-Forwarded-Scheme, X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Prefix and Host. For Mendix 10 and above, ApplicationRootUrl will take precedence over these headers. If you host a single application on two or more domains, you will have to choose one of the domains to represent the public-facing URL.
Log File Settings
The settings below influence the behavior of the log files. These settings can only be used on premises. In the cloud, these settings do not change any behavior.
Database Settings
Common Settings
| Name | Description | Default Value |
|---|---|---|
| ClientQueryTimeout | Defines the timeout in seconds for most of the database queries which are executed to load data into client widgets, like data grids. After the duration as specified here, a query will be canceled and an exception will be thrown. | |
| DatabaseType | Defines the database engine which is used as the Mendix database. Valid values are HSQLDB, MYSQL, ORACLE, POSTGRESQL, SAPHANA, and SQLSERVER. |
|
| DatabaseUserName | Name required for authentication to the database. | |
| DatabasePassword | Password for the DatabaseUserName supplied above. |
|
| DatabaseHost | The host name and optionally the TCP port number of the database. Use a colon (:) as separator between the host name and port number. Possible values are: db.url.org, db.url.org:1521, 10.0.0.5, and10.0.0.5:1433. It is possible to use a plain IPv6 address by enclosing it in brackets (for example, [::1]:5432).This will be overridden if you supply DatabaseJdbcUrl. |
|
| DatabaseName | The name of the database or schema used by the Mendix app Some database types require this even if a DatabaseJdbcUrl is defined. |
|
| DatabaseJdbcUrl | Defines the JDBC URL to use for the database connection (which overrides the other database connection settings). | |
| DatabaseUseSsl | When true, the connection will be made using SSL without certificate validation. If you need certificate validation, use DatabaseJdbcUrl instead.When false, the connection will be made without SSL (this is only relevant for SQL Server, which uses SSL by default). |
|
| DatabaseUseIntegratedSecurity | This setting defines whether integrated security will be used to authenticate to SQL Server. If true, user name and password will not be used. Ensure that the proper domain user for accessing the SQL Server is authenticated on the runtime server using the kinit command. |
false |
| LogMinDurationQuery | Defines whether database queries are logged via the ConnectionBus_Queries log node if they finished after the number of milliseconds specified here. By default, only the relevant SQL query will be logged. Set the log level of the ConnectionBus_Queries log node to TRACE to show more information about the page or the microflow which leads to this query. |
|
| OracleServiceName | Defines the SERVICE_NAME when you have a connection with an Oracle DBMS. |
|
| DataStorage.EnableDiagnostics | This setting can be used to generate a uniqueness constraint violation report. | false |
| UseNetworkTimeout | This setting is applied to PostgreSQL. It affects the timeout mechanism used when reserving new ids for Mendix objects. If set to true, the socket level request timeout is used. In that case, the request timeout is handled within the operating system. If set to false, the timeout is handled by Mendix runtime. For other databases, timeouts are always handled by Mendix runtime. | true |
| JdbcLoginTimeout | This setting defines the database connection establishment time in milliseconds. | 5000 (5 seconds) |
| DataStorage.OptimizeSecurityColumns | When true, query columns generated to evaluate XPath constraints in access rules are optimized to true if the runtime can determine that the value will always be true for the objects that the query returns. This is almost always an improvement, but we have seen cases where the PostgreSQL query planner has worse performance for the simpler query. |
true |
Connection Pooling
The settings below are used to define the database connection pooling behavior. Mendix Runtime uses a pool of reusable database connections. You can, for example, define how many connections can be used. Connection pooling is implemented using the Apache Commons Object-pooling API.
These settings are configured per runtime instance. If you have scaled your application, the number of connections on the database side will be multiplied by the number of runtime instances. For example, if you set ConnectionPoolingMaxIdle to 50 and scale your app to 2 runtime instances, each runtime instance will create at most 50 connections, but on the database side this will lead to a maximum of 100 connections.
| Name | Value | Default Value |
|---|---|---|
| ConnectionPoolingMaxWait | When the maximum number of "active" objects has been reached, the pool is said to be "exhausted." The "when exhausted" action used by the connection bus is WHEN_EXHAUSTED_BLOCK. Sets the maximum amount of time (in milliseconds) the borrowObject() method should block before throwing an exception when the pool is exhausted. When less than or equal to 0, the borrowObject() method may block indefinitely. (!) |
10000 (10 seconds) |
| ConnectionPoolingMaxActive | Sets the cap on the total number of active instances from the pool. | 50 |
| ConnectionPoolingMaxIdle | Sets the cap on the number of "idle" instances in the pool. | 50 |
| ConnectionPoolingMinIdle | Sets the minimum number of objects allowed in the pool before the evictor thread (if active) spawns new objects. Note that no objects are created when numActive + numIdle >= maxActive. This setting has no effect if the idle object evictor is disabled (as in, if timeBetweenEvictionRunsMillis <= 0). |
0 |
| ConnectionPoolingTimeBetweenEvictionRunsMillis | Sets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. | 300 000 (5 minutes) |
| ConnectionPoolingSoftMinEvictableIdleTimeMillis | Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any), with the extra condition that at least minIdle objects remain in the pool. When non-positive, no objects will be evicted from the pool due to idle time alone. |
300 000 (5 minutes) |
| ConnectionPoolingNumTestsPerEvictionRun | Sets the maximum number of objects to examine during each run of the idle object evictor thread (if any). When a negative value is supplied, ceil(getNumIdle())/ abs(getNumTestsPerEvictionRun()) tests will be run. This means that when the value is -n, roughly one nth of the idle objects will be tested per run. |
-3 |
| ConnectionPoolingTestOnBorrow | If true, a database connection will be validated by the connection pool before returning it to the application. This can be useful in situations where database connections can be closed by processes outside of the Mendix runtime, like firewalls. |
false |
| ConnectionPoolingTestOnCreate | If true, a database connection will be validated by the connection pool after being created. |
false |
| ConnectionPoolingTestOnReturn | If true, a database connection will be validated by the connection pool when it is returned to the pool by the application. |
false |
| ConnectionPoolingTestWhileIdle | If true, all idle database connections will be validated when the idle object evictor runs. |
false |
Migration Settings
The settings below are used to define the source database from which all data should be copied to the main database. You have to specify the settings below only once. The main database should exist and should be empty. During the app start-up, the data will be copied if the settings below are specified. Remove the settings afterward, because they are not needed anymore.
Before the data copying process starts, the main database structure will be generated based on the source database structure. This is necessary to make sure all the data is copied without any problems, especially in cases where the source database has a larger element value than the current domain model specifies.
| Name | Value | Default Value |
|---|---|---|
| SourceBuiltInDatabasePath | Defines the file location of the built-in source database. This setting is only necessary if a non-default location of the built-in database has to be used to copy the data from. | [deployment folder]/data/database |
| SourceDatabaseHost | The host name and optionally the TCP port number of the source database. Use a colon as separator between host name and port number. Possible values are: db.url.org, db.url.org:1521, 10.0.0.5, or 10.0.0.5:1433. It's possible to use a plain IPv6 address by enclosing it in brackets (for example, [::1]:5432). |
|
| SourceDatabaseJdbcUrl | Defines the JDBC URL to use for the source database connection (which overrides the other source database connection settings). | |
| SourceDatabaseName | The name of the source database. | |
| SourceDatabasePassword | The password for the connection to the source database. | |
| SourceDatabaseType | The type of the source database. Possible values: HSQLDB, MYSQL, ORACLE, POSTGRESQL, SAPHANA, or SQLSERVER. |
|
| SourceDatabaseUseIntegratedSecurity | This setting defines whether integrated security will be used to authenticate to SQL Server. If true, user name and password will not be used. See DatabaseUseIntegratedSecurity for more information. | false |
| SourceDatabaseUseSsl | When true, the connection to the source database will be made using SSL without certificate validation. If you need certificate validation, use SourceDatabaseJdbcUrl instead.When false, the connection to the source database will be made without SSL (this is only relevant for SQL Server, which uses SSL by default). |
|
| SourceDatabaseUserName | The user name for the connection to the source database. | |
| SourceOracleServiceName | Defines the SERVICE_NAME when you have a connection with an Oracle DBMS as source. |
S3 Storage Service Settings
The settings described below influence the behavior of the Amazon S3 Storage Service module. This module can be used for both Amazon S3 Storage and IBM Cloud Object Storage.
| Name | Description | Default Value |
|---|---|---|
| com. |
Acts as the username to authenticate with the S3 service. | |
| com. |
Acts as the password to authenticate with the S3 service. | |
| com. |
Name of the bucket where the files are stored on S3. | |
| com. |
Prefix for the keys under which objects are stored. Separators are not added automatically to keys. For keys like prefix/key1, com.mendix.storage.s3.ResourceNamePrefix should have value prefix/. |
|
| com. |
Suffix for the keys under which objects are stored. This can be used when S3 buckets are divided into different segments for different users with different credentials (for example, store objects as [key].customer1 for customer1 and as [key].customer2 for customer2). Separators are not added automatically to keys. For keys like key1.customer1, com.mendix.storage.s3.ResourceNameSuffix should have value .customer1. |
|
| com. |
Sets the region in which the S3 bucket is located. This will be used to determine the service endpoint, unless overridden in com. In Mendix version 11.6.0 and above, this setting is mandatory. The runtime will not start if this setting is not configured.
Using an incorrect region can lead to the following errors:
Unable to load region from any of the providers in the chain.The bucket you are attempting to access must be addressed using the specified endpoint.The authorization header is malformed; the region 'us-east-1' is wrong.
|
|
| com. |
Overrides the default endpoint. This setting is required when the storage is on a non-AWS location (for example, IBM Cloud Object Storage). Both the endpoint (for example, s3.example.com) or the full URL (including the protocol) are supported (for example, https://s3.example.com). Note that when setting a custom endpoint, path style access will be enabled. For more information, see Class S3ClientOptions. |
|
| com. |
Lets the authentication policy use Signature Version 2 instead of the default Signature Version 4. Set this setting to true when the endpoint does not support Signature Version 4.This setting is not supported in Mendix version 11.6.0 and above. |
false |
| com. |
List of keys which can be used to encrypt and decrypt data at rest in S3. The right key to decrypt the data with is automatically selected depending on with which key it was encrypted. Each encryption key consists of a key id, the encryption algorithm and the actual key (Base64 encoded). In Mendix version 11.6.0 and above, only AES encryption algorithm is supported. See S3 Encryption Key Update for migration information and how to configure the setting. |
|
| com. |
The value true allows the server to route requests to a different region than specified in these settings (false disallows it). |
true |
| com. |
Overrides the default maximum connections limit in the S3 service. The default value is enough for most applications, so we do not recommend explicitly setting this to a custom value unless a larger maximum connections limit is absolutely necessary. | DEFAULT_MAX_CONNECTIONS field of the ClientConfiguration interface in the AWS SDK for Java. |
| com. |
Sets the amount of time (in milliseconds) to allow a call to the storage service to complete. A value of 0 means no timeout. For more information, see the AWS Java SDK. |
0 (no timeout) |
| com. |
Sets the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out. A value of 0 means infinity and is not recommended. For more information, see the AWS Java SDK. |
10.000 (10 seconds) |
| com. |
Sets the amount of time to wait (in milliseconds) for data to be transferred over an established, open connection before the connection times out and is closed. A value of 0 means infinity and is not recommended. For more information, see the AWS Java SDK. |
50.000 (50 seconds) |
| com. |
Sets the amount of time to wait (in milliseconds) for the request to complete before giving up and timing out. A value of 0 means no timeout. For more information, see the AWS Java SDK. |
0 (no timeout) |
| com. |
Set this value to true to use the configured CACertificates for the connection to the S3 service. |
false |
| FileStorage. |
Set this value to true to disable chunked transfer encoding when uploading files to S3 storage. This setting can be useful when working with S3-compatible storage services that do not fully support chunked encoding.`This setting was introduced in Mendix version 11.10.0 and 11.6.6 MTS |
false |
Microsoft Azure SQL
These settings can be changed to use a Microsoft Azure SQL database for your Mendix application.
First, you need to create an Azure SQL database (for information on how to do this, see this SQL Database Tutorial). Make sure your Azure firewall settings allow your Mendix application to reach the Azure SQL database (by default, the Azure firewall does not allow external connections).
| Name | Description | Default Value |
|---|---|---|
| DatabaseType | SQLSERVER |
|
| DatabaseHost | "your-database-host.database.windows.net:1433" |
|
| DatabaseName | your-databasename |
|
| DatabaseUserName | your-username |
|
| DatabasePassword | your-password |
DatabaseUserName and DatabasePassword is appending Authentication=ActiveDirectoryDefault to the DatabaseJdbcUrl setting.
This will use the credential information present in the running environment to connect to the database. See Connect using ActiveDirectoryDefault authentication mode and DefaultAzureCredential Class in the Microsoft documentation for more information.
Microsoft Azure Blob Storage Settings
These settings can be used to store files using the Microsoft Azure blob storage service. Server-side encryption can be configured through the Azure Portal (for more information, see Azure Storage encryption for data at rest).
| Name | Description | Default Value |
|---|---|---|
| com. |
Has to be set to com.mendix.storage.azure to select Azure as the storage service. |
|
| com. |
Account name to authenticate with the Azure blob storage service. | |
| com. |
Account key to authenticate with the Azure blob storage service. | |
| com. |
Provides delegated access to resources in your storage account. For more information, see Shared Access Signature on docs.microsoft.com. | |
| com. |
Enables the use of the credential information present in the running environment. For more information, see DefaultAzureCredential on Microsoft Learn. | |
| com. |
Set the blob endpoint. This setting is required when authentication by SharedAccessSignature or UseDefaultAzureCredential is used. |
|
| com. |
Name of the container containing the blob. | |
| com. |
Indicates whether to check if the container exists, and creates it if it does not exist. | true |
| com. |
Maximum number of parallel multi-part file uploads/downloads. We advise not changing this setting unless you experience slow file transfers for large files. Choosing larger values will lead to higher memory usage. | 5 |
| com. |
For enabling or disabling secure connections using HTTPS. Can be true or false. |
true |
| com. |
Sets the amount of time (in milliseconds) to allow a call to the storage service to complete. For more information, see the Azure libraries. | No timeout |
| com. |
Sets the maximum execution time (in milliseconds) to use when making this request. For more information, see the Azure libraries. | No maximum time |
¹ The com.mendix.storage.azure.BlobEndpoint setting can include the container name, as in https://storageaccount.blob.core.windows.net/some-container-name. In this case the value in the com.mendix.storage.azure.Container setting will be used as a directory name.
This behavior is broken in the following versions
- 8.18.28
- 9.24.14, 9.24.15, 9.24.16, 9.24.17, 9.24.18
- 10.6.1, 10.6.2, 10.6.3, 10.6.4, 10.6.5, 10.7.0, 10.8.0, 10.8.1.
In these versions, the container name in the com.mendix.storage.azure.BlobEndpoint setting is ignored and files are stored at the root of the container. If you upgrade to one of these versions from a previous version, you will no longer have access to any files uploaded previously.
UseHttps setting above to revert to the previous default behavior and disable HTTPS.
Web Client Settings
The settings below influence the behavior of the Mendix web client.
| Name | Description | Default Value |
|---|---|---|
| EnableKeepAlive | Defines whether the web client sends a keep alive request every SessionTimeout/2 milliseconds in order to prevent a session timeout. Each click in the browser also acts as KeepAlive. Disabling this property will result in the user being logged out automatically after SessionTimeout milliseconds of inactivity (default 10 minutes), even if the browser remains open. See SessionTimeout for more information. |
true |
| com.mendix.offline.DeleteAutoCommittedObjectsAfterSync | Defines if auto-committed created during offline synchronization will be deleted from the database immediately. Deprecated – should only be changed if you have compatibility issues upgrading from Mendix version 9. |
true |
| com.mendix.offline.SynchronizationCleanupInterval | This setting defines how often objects of type System.OfflineSynchronizationHistory are cleaned up. |
90 (90 days) |
| com. |
Determines how many minutes your token will remain valid before re-authenticating using your full credentials. If no value is set, the token will expire after One year. | Introduced in Mendix 11.3. Use com. |
| com. |
Legacy alias of com. |
|
| com. |
A warning is logged when the feedback size exceeds the threshold. Feedback is sent from server to client to instruct (for example, to refresh objects or to open a page). They are serialized as "instructions" in the server response. If there are too many instructions, this can have performance implications, as they all have to be serialized to the client. For this reason, a warning is logged when the threshold is exceeded. | 5000 |
| com. |
A warning is logged when the state size exceeds the threshold. The state consists of changes in objects and of objects not committed to the database (yet). If there is too much state, this will have performance implications, as the whole state has to be serialized to the client. For this reason, a warning is logged when the threshold is exceeded. | 100 |
| com. |
The threshold controls how much data is sent back to the client after executing a microflow. By default, we send back full objects when they are changed or committed. When this threshold is reached, only object GUIDs are sent back instead so that the client knows about the changes while the amount of data sent over the network is reduced. The client will then retrieve the objects later on, if needed. | 100 |
| MaxRetrieveAmount | The maximum number of objects the client is allowed to retrieve by list widgets using database datasource runtime operation. When requesting more objects than allowed, the runtime will enforce the MaxRetrieveAmount by setting a limit on the query and will log the following warning: A retrieve action requested more objects than allowed by the MaxRetrieveAmount runtime setting. Amount requested: (...), MaxRetrieveAmount: (...).This setting was introduced in Mendix version 11.8.0 and 11.6.5 MTS |
Metrics Settings
The settings below configure metrics through micrometer. See Metrics for more information and the specification of the settings format.
| Name | Description | Default Value |
|---|---|---|
| com.mendix.metrics.Type | Enable access to Micrometer metrics through Java APIs | micrometer |
| Metrics.Registries | Registries to send metrics to | |
| Metrics.ApplicationTags | Common tags used for every meter |
OpenTelemetry Settings
The setting below configures observability (metrics, tracing, logs) through OpenTelemetry. See OpenTelemetry for information on setting up OpenTelemetry.
| Name | Description | Default Value |
|---|---|---|
| OpenTelemetry.MinimalMode | Enable OpenTelemetry minimal tracing mode. When true, only generates incoming or outgoing spans. Introduced in Mendix version 11.15.0 |
false |
Proxy Settings
Http(s) Connections
The settings below configure the app to use a proxy for all connections, whether they are using the HTTP or HTTPS protocol. They are used in the following circumstances:
- In the integration microflow activities call web service, call REST service, send REST request, and call external action.
- In the external object microflow activities send external object and delete external object.
- When retrieving an external entity data using a consumed OData service.
- When calling the Mendix runtime API Core.Http().executeHttpRequest and HttpConfiguration.getInstance().getProxyConfiguration().
These settings can be set either as JVM properties or as custom Runtime settings. When both the JVM property and custom runtime setting are set, the app uses the custom runtime setting.
| Name | Description | Default Value |
|---|---|---|
| http.proxyHost | Defines the hostname of the HTTP proxy server. | |
| http.proxyPort | Defines the port number of the HTTP proxy server. | |
| http.proxyUser | Defines the user of the HTTP proxy server. | |
| http.proxyPassword | Defines the password of the HTTP proxy server. | |
| http.nonProxyHosts | See below |
http. part of the names of these settings does not imply anything about whether the HTTP or HTTPS protocol is used - it is just the name of the setting.
License Server
The settings below configure the app to use a proxy to reach the Mendix license server.
| Name | Description | Default Value |
|---|---|---|
| https.proxyHost | Defines the hostname of the HTTPS proxy server. | |
| https.proxyPort | Defines the port number of the HTTPS proxy server. | |
| https.proxyUser | Defines the user of the HTTPS proxy server. | |
| https.proxyPassword | Defines the password of the HTTPS proxy server. | |
| http.nonProxyHosts | See below |
https. part of the names of these settings does not imply anything about whether the HTTP or HTTPS protocol is used - it is just the name of the setting.
Non-Proxy Hosts
http.nonProxyHosts for http(s) connections was introduced in Mendix 11.10.0.
The http.nonProxyHosts setting defines a list of hosts that should be reached directly, bypassing the proxy. This is a list of patterns separated by '|'.
This setting applies to both http(s) connections and the license server:
- Http(s) connections – the patterns may start or end with a '*' for wildcards
- License server – the runtime ignores wildcards