Class InMemoryProgressTracker

java.lang.Object
com.opencqrs.framework.eventhandler.progress.InMemoryProgressTracker
All Implemented Interfaces:
ProgressTracker

public class InMemoryProgressTracker extends Object implements ProgressTracker
ProgressTracker implementation using an in-memory Map. This implementation is discouraged for EventHandlers that rely on persistent progress while processing events, since the current(String, long) current progress} is reset upon restart of the JVM.
  • Constructor Details

    • InMemoryProgressTracker

      public InMemoryProgressTracker()
  • Method Details

    • current

      public Progress current(String group, long partition)
      Description copied from interface: ProgressTracker
      Retrieves the current Progress for the specified event processing group and partition.
      Specified by:
      current in interface ProgressTracker
      Parameters:
      group - the processing group identifier
      partition - the partition number
      Returns:
      the current progress
    • proceed

      public void proceed(String group, long partition, Supplier<Progress> execution)
      Description copied from interface: ProgressTracker
      Proceeds the current Progress by executing the given Supplier, which in turn yields the new progress for the specified event processing group and partition.
      Specified by:
      proceed in interface ProgressTracker
      Parameters:
      group - the processing group identifier
      partition - the partition number
      execution - the supplier returning the new progress, if executed successfully