Overwriting Spring Configuration
Elastic Path provides two files to overwrite the Spring configuration in your deployed Elastic Path applications:
ep.properties
Overwrites property placeholders defined in the application’s Spring configuration.
ep.override.properties
Overwrites the values of any Spring bean in the application Spring configuration.
ep.properties
Using the ep.properties
file provides a convenient way to customize your deployed applications. This section describes how to create the ep.properties
file and lists the web application settings this file can override.
To create an ep.properties
file:
Create a file named
ep.properties
in one of the following configuration directories:- Windows:
C:\ep\conf or C:\Users\<username>\ep\conf
- Linux and macOS:
/ep/conf
or~/ep/conf
- Windows:
In
ep.properties
, define the property values you want to set and save your changes.Restart your server for the changes to take effect.
Batch Server Properties
ep.cm.topseller.delay
Developer Default: 30000
Specifies the initial delay (in milliseconds) before the server will start to calculate the top sellers
ep.cm.topseller.interval
Developer Default: 30000
Specifies the delay (in milliseconds) between recalculations of the top sellers
ep.cm.productrecommendation.delay
Developer Default: 30000
Specifies the initial delay (in milliseconds) before the server will start to calculate product recommendations
ep.cm.productrecommendation.interval
Developer Default: 30000
Specifies the delay (in milliseconds) between recalculations of product recommendations
ep.cm.searchterms.aggregator.delay
Developer Default: 30000
Specifies the delay (in milliseconds) before the server will start tracking search term activity.
ep.cm.searchterms.aggregator.interval
Developer Default: 30000
Specifies the delay (in milliseconds) between updates of search term activity tracking.
Search Server Properties
ep.search.contextURL
Developer Default: /searchserver
The search server web application context.
ep.search.port.http
Developer Default: 8080
The search server HTTP port.
ep.index.build.delay
Developer Default: 10000
Specifies the initial delay (in milliseconds) before the server will start to update the customer search index.
ep.index.build.interval
Developer Default: 5000
Specifies the delay (in milliseconds) between updates of the customer search index.
ep.search.requires.master
Developer Default: false
When set to true, the Search Server, for which the value is set, becomes the primary Search Server. For more information, see Search Server Clustering.
ep.search.triggers
Disables Search Server indexing when set to disabled. This setting is used to disable the Search replica’s indexing. For more information, see Search Server Clustering.
Cortex Properties
bundle.environment
Developer Default: dev-bundles
Specifies the Cortex work environment. Possible values are dev-bundles
or prod-bundles
.
bundle.location
Developer Default: ${project.build.directory}/extensions
Specifies where Cortex Resource Extensions are deployed.
JMS (Java Messaging Service) Properties
ep.jms.type
Developer Default: org.apache.activemq.pool.PooledConnectionFactory
The Java Class type of the JMS Broker Connection Factory.
ep.jms.factory
Developer Default: org.apache.activemq.jndi.JNDIReferenceFactory
The JNDI resource factory used by the application.
ep.jms.url
Developer Default: tcp://localhost:61616
The URL of the JMS broker.
Global Settings
ep.external.ehcache.xml.path
Specifies the path to the external Ehcache configuration file. This property affects all web applications (Cortex, CM Server, Search Server and Integration Server). For more information, see Configuring Ehcache.
The file path in ep.external.ehcache.xml.path
must be absolute. The supported formats are shown in the following examples:
- Using Home Directory:
${user.home}/ep/conf/cache/ehcache.xml
- Absolute Path:
- Linux:
/ep/conf/cache/ehcache.xml
- Windows:
c:/ep/conf/cache/ehcache.xml
- Linux:
- File:
- Linux:
file:///ep/conf/cache/ehcache.xml
- Windows:
file:///c:/ep/conf/cache/ehcache.xml
- Linux:
Additional Slash
The additional slash in file:///
is required by Spring.
ep.database.timezone
Specifies the time zone to display in Commerce Manager. Set this value to any valid UTC time offset, time zone abbreviation, or tz database time zone value. We recommend the tz database time zone values so that the system properly adapts to time zone changes. Default is UTC time offset.
ep.override.properties
With the ep.override.properties
file, you can override the values of any bean running in a deployed application.
Navigate to one of the following directories and create the
ep.override.properties
file:- Windows:
C:\ep\conf or C:\Users\<username>\ep\conf
- Linux and macOS:
/ep/conf
or~/ep/conf
- Windows:
In the
ep.override.properties
file, define the required property values or bean references.- To override a bean property, see Overriding a bean property
- To override a bean reference, see Overriding a bean reference
Restart your server for the changes to take effect.
Overriding Bean Property
ep.override.properties
uses the following syntax:
beanName.propertyName=value
beanName
: The bean idpropertyName
: The property name to overridevalue
: The new value of the property
For example, the following settings override OpenJPA’s DataCache
and RemoteCommitProvider
beans:
entityManagerFactory.jpaPropertyMap[openjpa.DataCache]=true
entityManagerFactory.jpaPropertyMap[openjpa.RemoteCommitProvider]=sjvm
Overriding Bean Reference
To override a Spring bean reference use the following syntax:
beanName.propertyName=#{newBeanName}
beanName
: The bean idpropertyName
: The property name to overridenewBeanName
: The new id of the bean
For example, the following setting enables topSellerJob
(disabled by default using the disabled list, a Spring bean defined in commerce-engine/batch/ep-batch/src/main/filtered-resources/spring/scheduling/quartz-setup.xml
) in the Batch Server:
topSellerSchedulingTriggersMerger.mergeList=#{topSellerSchedulingTriggers}