Class OutboxProcessingScheduler

  • All Implemented Interfaces:

    
    public final class OutboxProcessingScheduler
    
                        

    Scheduler responsible for processing outbox records at regular intervals.

    This class implements the core scheduling and processing logic for the outbox pattern. It acquires locks on aggregates, processes pending records, and handles failures and retries.

    Since:

    0.1.0

    Author:

    Roland Beisel

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Unit process() Main processing method that runs on a scheduled interval.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OutboxProcessingScheduler

        OutboxProcessingScheduler(OutboxRecordRepository recordRepository, OutboxRecordProcessor recordProcessor, OutboxLockManager lockManager, OutboxRetryPolicy retryPolicy, OutboxProperties properties, Clock clock)
        Parameters:
        recordRepository - Repository for accessing outbox records
        recordProcessor - Processor for handling individual records
        lockManager - Manager for acquiring and releasing locks
        retryPolicy - Policy for determining retry behavior
        properties - Configuration properties
        clock - Clock for time-based operations
    • Method Detail

      • process

        @Scheduled(fixedDelayString = "${outbox.poll-interval}") final Unit process()

        Main processing method that runs on a scheduled interval.

        Finds aggregates with pending records, acquires locks, and processes records for each aggregate in a thread-safe manner.