Broadleaf Microservices
  • v1.0.0-latest-prod

Scheduled Job Release Notes for 2.1.4-GA

New Features & Notable Changes

Support for Flash Sale

  • A new scheduled job that will purge (hard delete) any PriceDataUsageDetails that are older than 30 days was added, which will run every day at midnight by default. The usage date threshold can be configured via the purgePriceDataUsageDetailsOlderThan scheduled job detail.

  • Please refer to Purge PriceDataUsageDetails Scheduled Job for more details.

Support to view Scheduled Job Execution Details

  • Users can now view the execution details of any scheduled job similar to that of Import/Export and Reindex jobs.

    • Execution details like Trigger Time, Start Time, End Time, Execution Status, Notes and Errors can be viewed. This is supported by the new domain ScheduledJobExecutionDetail.

    • A new flag trackExecutionDetails has been added to the ScheduledJob domain to enable/disable tracking of execution details.

    • On the Admin UI, a new section Execution Details is displayed when the trackExecutionDetails flag is enabled. It contains a grid that displays the execution details of the scheduled job as shown in the screenshot below.

    • This is powered by the new ScheduledJobStartedEvent and ScheduledJobCompletedEvent events that are published when a scheduled job starts and completes respectively.

  • As an example, the PURGE_PRICE_DATA_USAGE_DETAIL scheduled job has been configured OOB to track its execution details. Any scheduled jobs that you desire to track the execution details of would have to be explicitly enable and add logic to opt in.

Execution Details Grid

Steps to opt in for tracking Scheduled Job Execution Details:

  1. Enable the flag trackExecutionDetails for the scheduled job.

  2. Add the following spring cloud stream binding in the service where the scheduled job listener is located:

  3. Add ScheduledJobStartedEventProducer and ScheduledJobCompletedEventProducer to @EnableBinding in the AutoConfiguration class.

  4. Lastly, update the scheduled job listener wire the producers and add the methods for tracking the start and end times of the job.

spring:
    cloud:
        stream:
            bindings:
                scheduledJobStartedEventOutput:
                    destination: scheduledJobStarted
                scheduledJobCompletedEventOutput:
                    destination: scheduledJobCompleted

Bug Fixes

  • Fixed an issue where scheduled jobs could cause an issue with notifications causing connection leaks.