Package org.occurrent.annotation
Enum Class Subscription.StartupMode
- All Implemented Interfaces:
Serializable,Comparable<Subscription.StartupMode>,Constable
- Enclosing class:
- Subscription
Specify how the subscription should behave during startup.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe 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.Occurrent will determine the startup mode based on the other properties of the subscription (such asSubscription.startAt()andSubscription.resumeBehavior()).The subscription will wait until it's started up fully before Spring continues starting the rest of the application. -
Method Summary
Modifier and TypeMethodDescriptionstatic Subscription.StartupModeReturns the enum constant of this class with the specified name.static Subscription.StartupMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Occurrent will determine the startup mode based on the other properties of the subscription (such asSubscription.startAt()andSubscription.resumeBehavior()). It'll useBACKGROUNDif the subscription needs to replay historic events before subscribing to new ones (e.g. ifSubscription.startAt()isSubscription.StartPosition.BEGINNING_OF_TIME), otherwiseWAIT_UNTIL_STARTEDwill be used. -
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 aorg.occurrent.subscription.api.blocking.SubscriptionPositionStorage(checkpointing), it'll never miss an event during startup. -
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
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
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 nameNullPointerException- if the argument is null
-