Broadleaf Microservices
  • v1.0.0-latest-prod

Checkout Inventory Reservations

The out-of-box Broadleaf checkout workflow includes an activity (InventoryAvailabilityValidationCheckoutWorkflowActivity) that’s responsible for reserving inventory for the cart’s items. In short, if the cart item’s related fulfillment item contains an InventoryReservationStrategy of SUBMIT_ORDER, then InventoryServices is called to reserve inventory during the checkout process.

As a reminder, the Broadleaf InventoryService supports two types of reservations: soft reservations (i.e. a reservation that will expire on its own & release the inventory) & hard reservations (i.e. a reservation that will not expire). The InventoryAvailabilityValidationCheckoutWorkflowActivity creates a soft reservation during the checkout process. If the checkout process is successful, then the soft reservation will be transitioned into a hard reservation via the OrderSubmittedInventoryAdjustmentMessageListener, based on the CheckoutCompletionEvent. If the checkout process is not successful, then the soft inventory reservations are held for 5 minutes before the reservation is automatically released.

Note

The FreeSoftInventoryScheduledJobListener & "Free Expired Soft Inventory Reservations" scheduled job are responsible for releasing expired soft reservations.

The time-to-live duration for soft inventory reservations can be modified by changing the minReservationDuration scheduled job detail for the "Free Expired Soft Inventory Reservations" job (id: freeSoftInventoryJobId | type: FREE_SOFT_INVENTORY).