Broadleaf Microservices
  • v1.0.0-latest-prod

Resource Lock Provider

Table of Contents

Overview

This service provides the ability to lock and unlock resources. The default implementation facilitates HTTP requests against the Cart Services endpoints for managing resource locks of carts—no other entities that Cart Operations works with need resource locking.

Configuration

ExternalCartProperties defines the properties used to configure ExternalResourceLockProvider, which is the default provider. These include:

  • broadleaf.cartoperation.cartprovider.url: The base url for an external cart service, which handles persistence of lists as well as carts.

  • broadleaf.cartoperation.cartprovider.resourceLocksUri: The context path for the endpoint that manages locking carts from Cart Operations. This is appended to the url property.

Example of building request from properties
UriComponentsBuilder.fromHttpUrl(properties.getUrl())
        .path(properties.getCartsUri())
        .pathSegment(cart.getId())
        .path(properties.getCartItemsUri())
        .toUriString();