java.lang.Object
com.broadleafcommerce.common.dataimport.messaging.BatchListener

public class BatchListener extends Object
Message handler for receiving batch requests
Author:
Phillip Verheyden (phillipuniverse)
  • 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 an ImportBatchHandler
      Returns:
      a BatchCompletion if there is a handler for the given batch or null 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

      protected List<ImportBatchHandler> getHandlers()
    • getIdempotentConsumptionService

      protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService()
    • getReference

      protected com.broadleafcommerce.common.extension.data.DataRouteReference getReference()