Handler

akka.projection.javadsl.Handler
See theHandler companion object
abstract class Handler[Envelope] extends HandlerLifecycle

Implement this interface for the Envelope handler in the Projection. Some projections may have more specific handler types.

It can be stateful, with variables and mutable data structures. It is invoked by the Projection machinery one envelope at a time and visibility guarantees between the invocations are handled automatically, i.e. no volatile or other concurrency primitives are needed for managing the state.

Supported error handling strategies for when processing an Envelope fails can be defined in configuration or using the withRecoveryStrategy method of a Projection implementation.

Attributes

Companion:
object
Source:
Handler.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ActorHandler[Envelope, T]
class StatefulHandler[State, Envelope]

Members list

Concise view

Value members

Abstract methods

def process(envelope: Envelope): CompletionStage[Done]

The process method is invoked for each Envelope. One envelope is processed at a time. The returned CompletionStage is to be completed when the processing of the envelope has finished. It will not be invoked with the next envelope until after the returned CompletionStage has been completed.

The process method is invoked for each Envelope. One envelope is processed at a time. The returned CompletionStage is to be completed when the processing of the envelope has finished. It will not be invoked with the next envelope until after the returned CompletionStage has been completed.

Attributes

Source:
Handler.scala

Concrete methods

def start(): CompletionStage[Done]

Invoked when the projection is starting, before first envelope is processed. Can be overridden to implement initialization. It is also called when the Projection is restarted after a failure.

Invoked when the projection is starting, before first envelope is processed. Can be overridden to implement initialization. It is also called when the Projection is restarted after a failure.

Attributes

Source:
Handler.scala
def stop(): CompletionStage[Done]

Invoked when the projection has been stopped. Can be overridden to implement resource cleanup. It is also called when the Projection is restarted after a failure.

Invoked when the projection has been stopped. Can be overridden to implement resource cleanup. It is also called when the Projection is restarted after a failure.

Attributes

Source:
Handler.scala