Class MultiStreamableEventSource

java.lang.Object
org.axonframework.messaging.eventstreaming.MultiStreamableEventSource
All Implemented Interfaces:
StreamableEventSource, TrackingTokenSource

public class MultiStreamableEventSource extends Object implements StreamableEventSource
A StreamableEventSource implementation that allows streaming event processors to process events from multiple underlying event sources. This is useful when events need to be consumed from:
  • Multiple event stores
  • Multiple Axon Server contexts
  • Different storage types (for example, an Event Store and a Kafka topic)

Events from the different sources are merged using a MergedMessageStream, with the order of event consumption determined by a configurable Comparator. The default comparator returns the oldest event available (based on the event's timestamp). Each source is tracked independently using a MultiSourceTrackingToken, which maintains the position for each individual source.

Since:
5.1.0
Author:
Allard Buijze, Greg Woods