Interface MultiStreamableEventSource.SourceCollector
- Enclosing class:
MultiStreamableEventSource
public static interface MultiStreamableEventSource.SourceCollector
Intermediate builder for collecting event sources before creating a MultiStreamableEventSource.
Allows adding multiple sources and provides terminal operations for creating the final instance.
-
Method Summary
Modifier and TypeMethodDescriptionand(String sourceName, StreamableEventSource source) Adds another event source to the collection.Creates a MultiStreamableEventSource using timestamp-based comparison (oldest event first).comparingUsing(Comparator<MessageStream.Entry<EventMessage>> comparator) Creates a MultiStreamableEventSource using a custom comparator.
-
Method Details
-
and
Adds another event source to the collection.- Parameters:
sourceName- A unique name identifying the source.source- The event source to add.- Returns:
- This SourceCollector for fluent chaining.
- Throws:
IllegalArgumentException- if the sourceName is already used.
-
comparingTimestamps
MultiStreamableEventSource comparingTimestamps()Creates a MultiStreamableEventSource using timestamp-based comparison (oldest event first). This is the default behavior, comparing events based on their timestamp.- Returns:
- A configured MultiStreamableEventSource instance.
-
comparingUsing
Creates a MultiStreamableEventSource using a custom comparator.- Parameters:
comparator- The comparator to use when deciding which message to process first. A result of<= 0means the message from the first stream is consumed first.- Returns:
- A configured MultiStreamableEventSource instance.
-