public class CatchupSubscriptionModelConfig extends Object
CatchupSubscriptionModel| Modifier and Type | Field and Description |
|---|---|
int |
cacheSize |
org.occurrent.eventstore.api.SortBy |
catchupPhaseSortBy |
SubscriptionPositionStorageConfig |
subscriptionStorageConfig |
| Constructor and Description |
|---|
CatchupSubscriptionModelConfig(int cacheSize)
Create a new
CatchupSubscriptionModelConfig will the given cache size. |
CatchupSubscriptionModelConfig(int cacheSize,
SubscriptionPositionStorageConfig subscriptionStorageConfig)
Create a new
CatchupSubscriptionModelConfig will the given settings. |
CatchupSubscriptionModelConfig(SubscriptionPositionStorageConfig subscriptionStorageConfig)
Create a new
CatchupSubscriptionModelConfig will the given subscription storage config. |
| Modifier and Type | Method and Description |
|---|---|
CatchupSubscriptionModelConfig |
catchupPhaseSortBy(org.occurrent.eventstore.api.SortBy sortBy)
Specify how to sort the events that are read from the event store during catch-up phase.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
public final int cacheSize
public final SubscriptionPositionStorageConfig subscriptionStorageConfig
public final org.occurrent.eventstore.api.SortBy catchupPhaseSortBy
public CatchupSubscriptionModelConfig(int cacheSize)
CatchupSubscriptionModelConfig will the given cache size. Will default to sort by time and then stream version (if time is the same for two events)
during the catchup phase. You can change this by calling catchupPhaseSortBy(SortBy).cacheSize - The number of cloud events id's to store in-memory when switching from "catch-up" mode (i.e. querying the EventStoreQueries API)
and "subscription" mode (Subscription). The cache is needed to reduce the number of duplicate events the occurs when switching.public CatchupSubscriptionModelConfig(SubscriptionPositionStorageConfig subscriptionStorageConfig)
CatchupSubscriptionModelConfig will the given subscription storage config. Will default to sort by time and then stream version (if time is the same for two events)
during the catchup phase. You can change this by calling catchupPhaseSortBy(SortBy).subscriptionStorageConfig - Configures if and how subscription position persistence should be handled during the catch-up phase.public CatchupSubscriptionModelConfig(int cacheSize,
SubscriptionPositionStorageConfig subscriptionStorageConfig)
CatchupSubscriptionModelConfig will the given settings. Will default to sort by time and then stream version (if time is the same for two events)
during the catchup phase. You can change this by calling catchupPhaseSortBy(SortBy).cacheSize - The number of cloud events id's to store in-memory when switching from "catch-up" mode (i.e. querying the EventStoreQueries API)
and "subscription" mode (Subscription). The cache is needed to reduce the number of duplicate events the occurs when switching.subscriptionStorageConfig - Configures if and how subscription position persistence should be handled during the catch-up phase.public CatchupSubscriptionModelConfig catchupPhaseSortBy(org.occurrent.eventstore.api.SortBy sortBy)
CatchupSubscriptionModel,
you can specify your own sortBy instance here. Note that you most likely need the sortBy instance be covered by an index for
it to work efficiently.
For example, in MongoDB, if you only sort by "time", then if two events have the exact same time, then the order returned from MongoDB is unspecified.
Thus the default value of sortBy is SortBy.ascending(TIME, STREAM_VERSION). However, say that your filter is
Filter.type(", then you could create an index, {type : 1, time : 1, _id : 1}, and call catchupPhaseSortBy(SortBy)
with SortBy.ascending(TIME, "_id"). This means that MongoDB can efficiently both search for the correct type and then perform a sort based on time,
but use "insertion order" if time is the same for two or more events. If you don't supply a filter, then you can instead create the index {time : 1, _id : 1}.
sortBy - The SortBy instance to use during catchup phase. Default is SortBy.ascending(TIME, STREAM_VERSION).CatchupSubscriptionModel.Copyright © 2022. All rights reserved.