Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This site contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Cortex Configuration Files

Cortex Configuration Files

Cortex uses a number of files for configuring various aspects of the API, like authorization and authentication. Property value changes in the Cortex configuration files are scanned and updated in the application during run time. It is not necessary to restart the server to update the values.

For more information, see Cortex Configuration Files.

Default Configuration Files

Elastic Path provides default Cortex configuration files in the extensions/database/ext-data module's environments/default/files/conf/cortex directory.

For development, these default configuration files need to be copied to your local file system following the instructions at Updating Configuration Files.

Cortex Configuration File Locations

Cortex scans the following directories for configuration files, reads the values, and updates them in the application.

  • /ep/conf/cortex
  • ${user.home}/ep/conf/cortex where ${user.home} is the path of your user home directory.

Customizing Cortex Configuration Properties

Below is a list of the configuration files Cortex supports out of the box.

authClientHost.config

Defines the URI for the Cortex authentication endpoint. For more information on authentication endpoints, see Cortex Authentication

Property Format

  1. mappings=["DEFAULT_HOST\=http://localhost:9080/cortex/authentication/user"]

Copy

The endpoint should be a combination of your host URI and the authentication URI, "/commerce-legacy/authentication/user".
Note: DEFAULT HOST
The DEFAULT_HOST is the default fallback endpoint. Different scopes can have different endpoints. For example:
  1. mappings=["DEFAULT_HOST\=http://localhost:9080/cortex/authentication/user", "telco\=http://localhost:13080/cortex/authentication/user"]

Copy

authTrustHeader.config

Defines the authentication endpoint trust header. For more information on endpoint trust headers, see Cortex Authentication

Property Format

  1. name="x-ep-trust-header
  2. value="<secret trust header>"

Copy

recommendationsPageSize.config

Defines the pagination page-size setting for recommendations. Since a large number of items may be available for recommendations, this page-size setting can limit the number of items retrieved per request.

Property Format

  1. rest.recommendations.page.size.VALUE=I"<positive integer>"

Copy

Example with 5 items per page:
  1. rest.recommendations.page.size.VALUE=I"5"

Copy

Note: The 'I' is required as it indicates the value is an integer.

systemReadyState.config

Defines the number of resource bundles required to register their veto before Cortex is in a ready state. During Cortex startup, resource bundles register a veto once the bundle becomes active. Before a quorum is reached, Cortex returns a 503 Service Unavailable HTTP status for any request.

Property Format

  1. quorumSize=I"<positive integer"

Copy

Example with 10 vetoes:
  1. quorumSize=I"10"

Copy

oauthTokenExpiry.config

Defines the authentication token's expiry time, in seconds. By default, the Cortex authentication tokens expire after 1 week (60 * 60 * 24 * 7 seconds).

Property Format

  1. seconds=L"token expiry seconds"

Copy

Example with 300 seconds:

  1. seconds=L"300"

Copy

roleHierarchy.config

Defines the role hierarchy used in Cortex authorizations. For more information on roles and permissions, see Cortex Authorization.

Property Format

  1. roles=["ROLE_LOWEST","ROLE_HIGHER",...,"ROLE_HIGHEST"]

Copy

relosExecutorService.config

Defines thread pool size and thread idle timeout in seconds for the RelOS Executor Service. By default, the thread pool size is 500 and the thread idle timeout is 120 seconds. For more information on roles and permissions, see Cortex Authorization.

Property Format
  1. threadPoolSize=I"<positive integer>"
  2. threadIdleTimeout=L"idle timeout in seconds"

Copy

Example with thread pool size of 1000 and thread idle timeout of 200 seconds:
  1. threadPoolSize=I"1000"
  2. threadIdleTimeout=L"200"

Copy

relosOperationResultCache.config

Defines maximum number of results in cache for the RelOs OperationResult Cache and the eviction timeout in seconds. By default, the maximum number of results in cache is 2000 and the eviction timeout is 60 seconds.

Property Format
  1. maxResults=I"<positive integer>"
  2. evictionTimeout=I"eviction timeout in seconds"

Copy

Example where the maximum number of results in cache is 3000 and eviction timeout is 100 seconds:
  1. maxResults=I"3000"
  2. evictionTimeout=I"100"

Copy