Extensions

Overview

Extension defines a pluggable interface that can be injected into the ActorSystem to extend its core functionality with custom or domain-specific behaviour.

Extensions provide a powerful mechanism to augment the actor system with capabilities not available out-of-the-boxβ€”such as support for event sourcing, metrics, and many more or dependency injection.

Once registered, an Extension becomes accessible from any actor's message context, making it easy to share cross-cutting concerns across the system.

Get Started

  1. Implement the Extensionarrow-up-right interface.

  2. Register the extension when creating the actor system using the WithExtensionsarrow-up-right option.

Once the above steps completed, you can always access the list of extensions of a given extension whenever handling a message using the following methods of the ReceiveContext

Example

A good example can be found herearrow-up-right.

Last updated