java.lang.Object
com.broadleafcommerce.cartoperation.service.messaging.idempotency.CartOpsMessageLockService
All Implemented Interfaces:
com.broadleafcommerce.common.messaging.service.MessageLockService

public class CartOpsMessageLockService extends Object implements com.broadleafcommerce.common.messaging.service.MessageLockService
A cart operations specific implementation of the message lock service. This version uses a resources lock provider since cart operations is not attached to a data source (DB) to store locks in.
Author:
Jacob Mitash
  • Field Details

  • Constructor Details

    • CartOpsMessageLockService

      public CartOpsMessageLockService(ResourceLockProvider resourceLockProvider)
  • Method Details

    • obtainLock

      public String obtainLock(@NonNull @NonNull org.springframework.messaging.Message<?> message, @NonNull @NonNull String listenerName)
      Specified by:
      obtainLock in interface com.broadleafcommerce.common.messaging.service.MessageLockService
    • releaseLock

      public void releaseLock(@Nullable String lockToken)
      Specified by:
      releaseLock in interface com.broadleafcommerce.common.messaging.service.MessageLockService
    • purgeLocks

      public void purgeLocks(Duration messageLockTtl)
      Specified by:
      purgeLocks in interface com.broadleafcommerce.common.messaging.service.MessageLockService