public final class EventSourcingBuilder extends Object
An event sourcing action is an action that is processed as a simple sourcing command against an aggregate.
Simple sourcing records the version number of an aggregate, called a sequence number, and every successful command results in this sequence number being incremented. The event sourcing action processor will ensure that only the saga can write to the aggregate, and if any other writes to the aggregate occur during the saga, the saga will fail. An optimistic lock is essentially held on the aggregate for the duration of the saga.
Constructor and Description |
---|
EventSourcingBuilder() |
Modifier and Type | Method and Description |
---|---|
static <A,D,K,C> ActionProcessorBuildStep<A> |
apply(EventSourcingSpec<A,D,K,C> esSpec) |
static <A,D,K,C> ActionProcessorBuildStep<A> |
apply(EventSourcingSpec<A,D,K,C> esSpec,
TopicConfigBuilder.BuildSteps actionTopicBuilder,
TopicConfigBuilder.BuildSteps commandTopicBuilder)
A static function that returns an action processor build step that:
1.
|
public static <A,D,K,C> ActionProcessorBuildStep<A> apply(EventSourcingSpec<A,D,K,C> esSpec, TopicConfigBuilder.BuildSteps actionTopicBuilder, TopicConfigBuilder.BuildSteps commandTopicBuilder)
A
- - common representation form for all action commands (typically Json / GenericRecord for Avro)D
- - intermediate decoded input type (that can easily be converted to both K and C)K
- - aggregate key typeC
- - simple sourcing command typeesSpec
- data structure specifying how to turn the action request into a command request and interpret the resultactionTopicBuilder
- the action topic builder - a mechanism for configuring the action topicscommandTopicBuilder
- the command topic builder - a mechanism for configuring the simple sourcing command topicspublic static <A,D,K,C> ActionProcessorBuildStep<A> apply(EventSourcingSpec<A,D,K,C> esSpec)
Copyright © 2019. All rights reserved.