Class ExportOrphanCheckListener
java.lang.Object
com.broadleafcommerce.common.dataexport.messaging.ExportOrphanCheckListener
@ConfigurationProperties("broadleaf.export.orphan-check")
public class ExportOrphanCheckListener
extends Object
A listener that accepts triggered scheduled job events of type
EXPORT_ORPHAN_CHECK_JOBTYPE
and adjusts the Export.status
of any exports that
are hanging to ExportStatus.ERROR
.- Author:
- Samarth Dhruva (samarthd)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExportOrphanCheckListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, List<ExportDataRouteSupporting> dataRoutes, ExportService<Export> exportService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ExportDataRouteSupporting>
protected ExportService<Export>
protected String
This value represents the amount of time that an export 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.IdempotentMessageConsumptionService
protected com.broadleafcommerce.common.extension.TypeFactory
protected void
handleMessage
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) void
listen
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Queries the data store for all exports withExportStatus.REQUESTED
andExportStatus.PROCESSING
statuses whoseExport.lastUpdated
is beyond an acceptable threshold from the current time.void
setHangingCutoff
(Duration hangingCutoff) This value represents the amount of time that an export is allowed to be idle (in a state of "REQUESTED" or "PROCESSING") before it is considered hanging and set to an error state.protected void
setHangingError
(Export export)
-
Field Details
-
EXPORT_ORPHAN_CHECK_JOBTYPE
- See Also:
-
-
Constructor Details
-
ExportOrphanCheckListener
public ExportOrphanCheckListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, @NonNull List<ExportDataRouteSupporting> dataRoutes, @NonNull ExportService<Export> exportService, @NonNull com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
listen
@StreamListener("triggeredJobEventInputOrphanExport") public void listen(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Queries the data store for all exports withExportStatus.REQUESTED
andExportStatus.PROCESSING
statuses whoseExport.lastUpdated
is beyond an acceptable threshold from the current time. Each of these records is updated to have anExportStatus.ERROR
.- Parameters:
scheduledJobRef
- a scheduled job trigger event - will only be handled if it has typeEXPORT_ORPHAN_CHECK_JOBTYPE
-
handleMessage
protected void handleMessage(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) -
setHangingError
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getHangingCutoff
This value represents the amount of time that an export 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 an export is allowed to be idle (in a state of "REQUESTED" or "PROCESSING") before it is considered hanging and set to an error state. -
getDataRoutes
-
getExportService
-
getTypeFactory
@NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getHANGING_ERROR_MESSAGE
-