Class BulkUpdateOrphanCheckListener
java.lang.Object
com.broadleafcommerce.bulk.messaging.BulkUpdateOrphanCheckListener
@ConfigurationProperties("broadleaf.bulk.orphan-check")
public class BulkUpdateOrphanCheckListener
extends Object
A listener that accepts triggered scheduled job events of type
BULK_UPDATE_ORPHAN_CHECK_JOBTYPE and adjusts the BulkUpdate.status of any bulk
updates that are hanging to BulkUpdateStatus.ERROR.- Author:
- Samarth Dhruva (samarthd)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBulkUpdateOrphanCheckListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, BulkUpdateService<BulkUpdate> bulkUpdateService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, List<BulkDataRouteSupporting> routes) -
Method Summary
Modifier and TypeMethodDescriptionprotected BulkUpdateService<BulkUpdate>This value represents the amount of time that a bulk update is allowed to be idle (in a state of "REQUESTED" or "PROCESSING") before it is considered hanging and set to an error state.protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionServiceprotected List<BulkDataRouteSupporting>protected com.broadleafcommerce.common.extension.TypeFactoryprotected voidhandleMessage(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) protected booleanisSandboxBulkUpdate(BulkUpdate bulkUpdate) voidlisten(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Queries the data store for all updates withBulkUpdateStatus.REQUESTEDandBulkUpdateStatus.PROCESSINGstatuses whoseBulkUpdate.lastUpdatedis beyond an acceptable threshold from the current time.protected voidnotifyOfDeleteSandboxRequest(String bulkUpdateId) protected voidsetErrorsAndDeleteSandbox(BulkUpdate hangingUpdate, List<BulkUpdateError> errors) voidsetHangingCutoff(Duration hangingCutoff) This value represents the amount of time that a bulk update is allowed to be idle (in a state of "REQUESTED" or "PROCESSING") before it is considered hanging and set to an error state.
-
Field Details
-
BULK_UPDATE_ORPHAN_CHECK_JOBTYPE
- See Also:
-
-
Constructor Details
-
BulkUpdateOrphanCheckListener
public BulkUpdateOrphanCheckListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, BulkUpdateService<BulkUpdate> bulkUpdateService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, List<BulkDataRouteSupporting> routes)
-
-
Method Details
-
listen
@StreamListener("triggeredJobEventInputOrphanBulk") public void listen(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Queries the data store for all updates withBulkUpdateStatus.REQUESTEDandBulkUpdateStatus.PROCESSINGstatuses whoseBulkUpdate.lastUpdatedis beyond an acceptable threshold from the current time. Each of these records is locked and updated to have anBulkUpdateStatus.ERROR.- Parameters:
message- a scheduled job trigger event - will only be handled if it has typeBULK_UPDATE_ORPHAN_CHECK_JOBTYPE
-
handleMessage
protected void handleMessage(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) -
setErrorsAndDeleteSandbox
-
notifyOfDeleteSandboxRequest
-
isSandboxBulkUpdate
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getHangingCutoff
This value represents the amount of time that a bulk update is allowed to be idle (in a state of "REQUESTED" or "PROCESSING") before it is considered hanging and set to an error state. -
setHangingCutoff
This value represents the amount of time that a bulk update is allowed to be idle (in a state of "REQUESTED" or "PROCESSING") before it is considered hanging and set to an error state. -
getBulkUpdateService
-
getTypeFactory
@NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getRoutes
-