Interface EventRead<T>

  • Type Parameters:
    T - The type of the event.

    public interface EventRead<T>
    An event that was read from a stream or a checkpoint marker if one has been requested.

    A checkpoint is an indication that the reading application should persist its state to durable storage before reading further. A checkpoint also represents a point where events waiting to be read may be rebalanced among the readers in a group. So before a checkpoint one reader might be handling all of the events sent with routing key X but afterwards it may be a different reader.

    • Method Detail

      • getEvent

        T getEvent()
        Returns the event that is wrapped in this EventRead or null a timeout occurred or if a checkpoint was requested.
        Returns:
        The event itself.
      • getPosition

        Position getPosition()
        The position in the stream that represents where the reader is immediately following this event. It is useful to store this so that ReaderGroup.readerOffline(String, Position) can be called if the reader dies.
        Returns:
        Position of the event
      • getEventPointer

        EventPointer getEventPointer()
        Returns a pointer object for the event read. The event pointer enables a random read of the event at a future time.
        Returns:
        Pointer to an event
      • isCheckpoint

        boolean isCheckpoint()
        A boolean indicating if this is a checkpoint. In which case getCheckpointName() will be non-null and getEvent() will be null.
        Returns:
        true if this is a checkpoint.
      • isReadCompleted

        boolean isReadCompleted()
        A boolean indicating if all events in the stream read completely. This is true when the streams are sealed and all events in the streams have already been read.
        Returns:
        true if all events in the stream read completely.