Package akka.javasdk.consumer
Class Consumer
Object
akka.javasdk.consumer.Consumer
Consumers are stateless components that can be used to implement different uses cases, such as:
- subscribe to events from an Event Sourced Entity.
- subscribe to state changes from a Key Value Entity.
Consumer.Effect
that describes what to do next.
Concrete classes can accept the following types to the constructor:
ComponentClient
HttpClientProvider
TimerScheduler
Materializer
Config
- Custom types provided by a
DependencyProvider
from the service setup
Concrete class must be annotated with ComponentId
and
one of the Consume
annotations.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An Effect is a description of what the runtime needs to do after the command is handled. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Consumer.Effect.Builder
effects()
protected final MessageContext
Additional context and metadata for a message handler.final TimerScheduler
timers()
Returns aTimerScheduler
that can be used to schedule further in time.
-
Constructor Details
-
Consumer
public Consumer()
-
-
Method Details
-
messageContext
Additional context and metadata for a message handler.It will throw an exception if accessed from constructor.
-
effects
-
timers
Returns aTimerScheduler
that can be used to schedule further in time.
-