A
- The action command type (shared across all actions)public class ActionApp<A> extends Object
An action processor application consists of one or more action processors.
The following action processors are provided out-the-box in Simple Sagas:
Event Sourcing Action processor
Async Action processor
To create a custom action processor, you can provide an implementation of the functional interface ActionProcessorBuildStep
.
In this implementation you define both the instructions for building the stream topology, and the details about the topics
that are required for this action processor (Note that each action processor uses its own set of topics)
It is recommended, though note essential to use this pattern to create action processors.
ActionProcessorBuildStep
implementations can also be
used to provide implementations of other sub-topologies that are not directly related to action processors.
ActionProcessorBuildStep
can be added to extend the action app topology in arbitrary ways.
This can be useful for transforming stream data that might be used by an action processor, and making this transformation part of the stream topology.
Modifier and Type | Method and Description |
---|---|
StreamBuildResult |
build(PropertiesBuilder.BuildSteps properties)
Builds the stream.
|
static <A> ActionApp<A> |
of(ActionSerdes<A> serdes) |
void |
run(PropertiesBuilder.BuildSteps properties)
Builds and runs the stream.
|
ActionApp<A> |
withActionProcessor(ActionProcessorBuildStep<A> processorBuildStep)
Adds an action processor build step to the application.
|
public static <A> ActionApp<A> of(ActionSerdes<A> serdes)
A
- The action command type (shared across all actions)serdes
- - the Serdes for the action request and response topics. Note that all action types share the same serdespublic ActionApp<A> withActionProcessor(ActionProcessorBuildStep<A> processorBuildStep)
Note that it is only possible to add one action processor per action type to a given action app instance, and this is enforced by the framework.
It is up to the user to ensure that there is only one action processor per action type running on the cluster (to ensure single processing of an action).
processorBuildStep
- - the action processor build steppublic StreamBuildResult build(PropertiesBuilder.BuildSteps properties)
properties
- a functional interface for setting or overriding the Kafka propertiespublic void run(PropertiesBuilder.BuildSteps properties)
properties
- a functional interface for setting or overriding the Kafka propertiesCopyright © 2019. All rights reserved.