Enum Class Subscription.StartupMode

java.lang.Object
java.lang.Enum<Subscription.StartupMode>
org.occurrent.annotation.Subscription.StartupMode
All Implemented Interfaces:
Serializable, Comparable<Subscription.StartupMode>, Constable
Enclosing class:
Subscription

public static enum Subscription.StartupMode extends Enum<Subscription.StartupMode>
Specify how the subscription should behave during startup.
  • Enum Constant Details

    • DEFAULT

      public static final Subscription.StartupMode DEFAULT
      Occurrent will determine the startup mode based on the other properties of the subscription (such as Subscription.startAt() and Subscription.resumeBehavior()). It'll use BACKGROUND if the subscription needs to replay historic events before subscribing to new ones (e.g. if Subscription.startAt() is Subscription.StartPosition.BEGINNING_OF_TIME), otherwise WAIT_UNTIL_STARTED will be used.
    • WAIT_UNTIL_STARTED

      public static final Subscription.StartupMode WAIT_UNTIL_STARTED
      The subscription will wait until it's started up fully before Spring continues starting the rest of the application. Most of the time this is recommended because otherwise there could be a small chance that a request is received to your application before the subscription has bootstrapped completely. This can lead to the subscription missing this event. This is only true if the subscription is brand new. As soon as the subscription has received an event that is stored in a
      invalid reference
      org.occurrent.subscription.api.blocking.SubscriptionPositionStorage
      (checkpointing), it'll never miss an event during startup.
    • BACKGROUND

      public static final Subscription.StartupMode BACKGROUND
      The subscription will NOT wait until it's started up fully before Spring continues starting the rest of the application, instead it will be started in the background. Typically, this is mainly useful if you instruct the subscription to start at an earlier date (such as beginning of time), and you have a lot of events to read before the subscription has caught up. In this case, you may wish to start the Spring application before the subscription has fully started (i.e. before all historic events have been replayed) because waiting for all events to replay takes too long. The subscription will then replay all historic events in the background, before switching to continuous mode.
  • Method Details

    • values

      public static Subscription.StartupMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Subscription.StartupMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null