Interface EventStore
- All Superinterfaces:
DescribableComponent,EventBus,EventSink,StreamableEventSource,SubscribableEventSource,TrackingTokenSource
- All Known Implementing Classes:
InterceptingEventStore,RecordingEventStore,StorageEngineBackedEventStore
EventStoreTransaction to
append events and
event source models from the underlying storage solution.
As an extension of the EventBus, this EventStore serves as both the event storage mechanism and
the event distribution mechanism. This dual role allows the EventStore to persist events durably while simultaneously
distributing them to subscribed event handlers, eliminating the need for a separate EventBus component in
event sourcing scenarios. Through the SubscribableEventSource capability inherited
from EventBus, components can subscribe
to receive events as they are stored. The exact timing of when events are published to subscribers is
implementation-dependent and may occur within the same transaction if the ProcessingContext is shared between
the storage and distribution operations.
As an implementation of the EventSink, this EventStore will initiate a
transaction(ProcessingContext) when EventSink.publish(ProcessingContext, List) is triggered to append events.
When a null ProcessingContext is given on EventSink.publish(ProcessingContext, List), the implementation
should decide to construct a context itself or fail outright.
As an implementation of the StreamableEventSource, this EventStore will allow for StreamableEventSource.open(org.axonframework.messaging.eventstreaming.StreamingCondition, org.axonframework.messaging.core.unitofwork.ProcessingContext) a
stream of events and use it as a source for
StreamingEventProcessor.
- Since:
- 0.1.0
- Author:
- Allard Buijze, Rene de Waele, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptiontransaction(ProcessingContext processingContext) Retrieves thetransaction for appending eventsfor the givenprocessingContext.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeToMethods inherited from interface org.axonframework.messaging.eventhandling.EventSink
publish, publishMethods inherited from interface org.axonframework.messaging.eventstreaming.StreamableEventSource
openMethods inherited from interface org.axonframework.messaging.core.SubscribableEventSource
subscribeMethods inherited from interface org.axonframework.messaging.eventstreaming.TrackingTokenSource
firstToken, latestToken, tokenAt
-
Method Details
-
transaction
Retrieves thetransaction for appending eventsfor the givenprocessingContext. If no transaction is available, a new, empty transaction is created.- Parameters:
processingContext- The context for which to retrieve theEventStoreTransaction.- Returns:
- The
EventStoreTransaction, existing or newly created, for the givenprocessingContext.
-