package de.accso.flexinale.common.api.eventbus;

// Behaviour on how a EventSubscriber (i.e. Consumer) reads new messages, after having subscribed to the EventBus
// - How much of the old messages are read or re-read (if any)?
// - Where do we start, at which offset?
public enum EventSubscriptionAtStart {
    // (re)read all messages from the EventBus from the very beginning (i.e. from offset 0)
    // In Kafka this is - for a new ConsumerGroup - "earliest".
    START_READING_FROM_BEGINNING,

    // read all messages from now on (so don't (re)read anything published before now)
    // In Kafka this is - for a new ConsumerGroup - "latest".
    START_READING_FROM_NOW,

    // read all messages from the EventBus, starting where we left off last time (so last offset we had + 1)
    // (if we had not connected before at all: start from beginning, i.e. from offset 0)
    // In Kafka this is - for a known ConsumerGroup - the default.
    START_READING_FROM_LAST_TIME
}
