Class ReceiptBatchProcessor

java.lang.Object
com.minicrm.mini_crm_api.messaging.ReceiptBatchProcessor

@Component public class ReceiptBatchProcessor extends Object
A dedicated background worker that consumes delivery receipts from a queue in batches and processes them for efficient database updates.
  • Constructor Details

    • ReceiptBatchProcessor

      public ReceiptBatchProcessor()
  • Method Details

    • handleReceiptBatch

      @RabbitListener(queues="${rabbitmq.receipt.queue.name}", containerFactory="batchListenerFactory") public void handleReceiptBatch(List<DeliveryReceiptDTO> receipts)
      Listens to the delivery receipt queue and consumes messages in batches. The batch size and timeout are configured in application.properties.
      Parameters:
      receipts - A list of DeliveryReceiptDTOs received from the queue.