Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center 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.

Scheduled Jobs (Batch Server)

Scheduled Jobs (Batch Server)

The batch server uses scheduled jobs to perform certain operations, such calculating top selling products and product recommendations. The quartz.xml file contains settings that configure how and when these jobs run. It is located in the batch/ep-batch/src/main/resources/spring/scheduling directory.

Some of these jobs can be configured to run at different intervals or to clear different amounts of data. For more information on how to do this, see Configuring System Settings.

Batch Server Quartz Jobs

The batch server has the following jobs:

Job Name Purpose Default Reoccurance Assosciated System Environment Variables
cleanupAbandonedCartsJob Purges abandoned shopping carts. 30 minutes COMMERCE/STORE/ABANDONEDCARTCLEANUP/maxHistory, COMMERCE/SYSTEM/ABANDONEDCARTCLEANUP/batchSize
cleanupAnonymousCustomerJob Purges anonymous customers. 5 minutes COMMERCE/STORE/ANONYMOUSCUSTOMERCLEANUP/maxHistory, COMMERCE/SYSTEM/ANONYMOUSCUSTOMERCLEANUP/batchSize
cleanupFailedOrdersJob Purges failed orders. 45 minutes COMMERCE/SYSTEM/FAILEDORDERCLEANUP/maxHistory, COMMERCE/SYSTEM/FAILEDORDERCLEANUP/batchSize
cleanupExpiredOAuth2TokensJob Purges expired OAuth tokens. Daily at midnight. None, configured in quartz.xml.
importJobCleanupProcessorJob Removes completed import jobs from the database based on their age. 172800 seconds (default max. age), 5 minutes (default timeout) COMMERCE/SYSTEM/IMPORT/importJobMaxAge, COMMERCE/SYSTEM/IMPORT/staleImportJobTimeout
inventoryJournalRollupJob Rolls up inventory journal. Delayed for 30 seconds upon batch server launch, then every 24 hours. None, configured in quartz.xml.
processImportJob Processes import jobs. Waits for 10 seconds, and repeats every 5 seconds. None, configured in quartz.xml.
productRecommendationJob Re-computes product recommendations. 30 seconds None, configured in quartz.xml.
releaseShipmentsJob Calls OrderService.updateOrderShipmentStatus() to release order shipments. Hourly, at the start of the hour (i.e. 1:00pm). None, configured in quartz.xml.
searchTermsAggregatorJob Aggregates search terms. Delayed for 30 seconds upon batch server launch, then every 30 seconds. None, configured in quartz.xml, CE/pom.xml, CE/pom.xml. searchTermsAggregatorJob properties are generally set during the build process, not runtime.
staleImportJobProcessorJob Processing stale import jobs. Delayed for 30 seconds upon batch server launch, then every minute. None, configured in quartz.xml.
topSellerJob Determines the latest top selling products for testing and demos. Delayed for 30 seconds, then every 30 seconds. None, configured in quartz.xml, CE/pom.xml, CE/pom.xml. topSellerJob properties are generally set during the build process, not runtime.

Computing Product Recommendations

A trigger is declared for computing product recommendation data. A SimpleTriggerBean is typically used to compute recommendations every 30 seconds for demonstration purposes. For production, use a CronTriggerBean to compute recommendations with a longer interval (for example, an interval of 24 hours).

Note:

Running the product recommendations job frequently on a large catalog with many orders can have a negative impact on performance. In a busy production environment, it is recommended that you schedule it to run at intervals of one hour (3600000 milliseconds) or more.

Computing the Top Sellers

A trigger is declared for computing the top selling product statistics. A SimpleTriggerBean is typically used to compute recommendations every 30 seconds for demonstration purposes. For production, use a CronTriggerBean to compute recommendations with a longer interval (for example, an interval of 24 hours).

Note:

Running the top sellers job frequently on a large catalog with many orders can have a negative impact on performance. In a busy production environment, it is recommended that you schedule it to run at intervals of one hour (3600000 milliseconds) or more.