Class BatchListener
java.lang.Object
com.broadleafcommerce.common.dataimport.messaging.BatchListener
Message handler for receiving batch requests
- Author:
- Phillip Verheyden (phillipuniverse)
-
Constructor Summary
ConstructorDescriptionBatchListener
(List<ImportBatchHandler> handlers, com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.data.DataRouteReference reference) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<BatchCompletionRecord>
buildErrorCompletionsForUnacknowledgedRecords
(@NonNull BatchCompletion completion, @NonNull BatchRequest request) protected BatchCompletion
doImport
(@NonNull org.springframework.messaging.Message<BatchRequest> message) protected List<ImportBatchHandler>
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
protected com.broadleafcommerce.common.extension.data.DataRouteReference
org.springframework.messaging.Message<BatchCompletion>
listen
(@NonNull org.springframework.messaging.Message<BatchRequest> message) Channel consumption for a batch request
-
Constructor Details
-
BatchListener
public BatchListener(List<ImportBatchHandler> handlers, com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.data.DataRouteReference reference)
-
-
Method Details
-
listen
@StreamListener("batchRequestInput") @SendTo("batchCompletionOutput") @Nullable public org.springframework.messaging.Message<BatchCompletion> listen(@NonNull @NonNull org.springframework.messaging.Message<BatchRequest> message) Channel consumption for a batch request- Parameters:
message
- the batch to handle and pass on to anImportBatchHandler
- Returns:
- a
BatchCompletion
if there is a handler for the givenbatch
ornull
if there was nothing to handle the batch
-
doImport
@Nullable protected BatchCompletion doImport(@NonNull @NonNull org.springframework.messaging.Message<BatchRequest> message) -
buildErrorCompletionsForUnacknowledgedRecords
protected List<BatchCompletionRecord> buildErrorCompletionsForUnacknowledgedRecords(@NonNull @NonNull BatchCompletion completion, @NonNull @NonNull BatchRequest request) -
getHandlers
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getReference
protected com.broadleafcommerce.common.extension.data.DataRouteReference getReference()
-