Spring Configuration
Elastic Path provides two files for overriding Spring configuration in your deployed Elastic Path applications:
ep.properties
Defines properties that can be used as configuration values in Spring XML.
ep.override.properties
Overrides the values of any Spring bean in the application Spring configuration.
ep.properties
Using the ep.properties
file provides a convenient way to provide configuration values to your deployed applications. This is enabled by the context:property-placeholder
functionality in Spring.
The Elastic Path Commerce services will read this file at startup from any of the following locations:
/etc/ep/ep.properties
/ep/conf/ep.properties
${user.home}/ep/ep.properties
${user.home}/ep/conf/ep.properties
These property values can be referenced in any Spring XML file using the following syntax:
${property.key}
${property.key:override}
Where property.key
represents the key defined in the ep.properties
file, and override
is an optional value that can be specified if the property key is not defined in ep.properties
.
The subsections below describe built-in properties that can be overridden through ep.properties
.
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.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
Using the ep.override.properties
file provides a way to override the values of any bean running in a deployed applications. This is enabled by the context:property-override
functionality in Spring.
The Elastic Path Commerce services will read this file at startup from any of the following locations:
/etc/ep/ep.override.properties
/ep/conf/ep.override.properties
${user.home}/ep/ep.override.properties
${user.home}/ep/conf/ep.override.properties
Overriding Bean Property with a Simple Value
To override a Spring bean property with a simple value use 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 Property with a Bean Reference
To override a Spring bean property with a reference to another bean 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}