johanhaleby / occurrent

Unintrusive Event Sourcing Library for the JVM
https://occurrent.org
120 stars 16 forks source link

Add "startAt" to @Subscription #160

Closed johanhaleby closed 4 months ago

johanhaleby commented 5 months ago

For example:

@Subscription(id="myId", startAt = ..)

where startAt can be an enum (to begin with):

enum SubscriptonStartPosition {
  DEFAULT, BEGINNING_OF_TIME
}

It would be even nicer we could do nested annotations to allow specifying eg

@Subscription(id="myId", startAt = @StartAt(iso8601="2024-04-12T05:53:53−07:00"))

or

@Subscription(id="myId", startAt = @StartAt(BEGINNING_OF_TIME))
johanhaleby commented 5 months ago

It would also be nice we one could specify (pseudo code):

@Subscription(id="myId", startAt = @StartAt(BEGINNING_OF_TIME, THEN_NEXT_TIME_CONTINUE_FROM_LAST_POSITION))