Extensions
Last updated
Last updated
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.
Implement the interface.
Register the extension when creating the actor system using the 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
- this returns the list of all extensions registered within the ActorSystem
.
- retrieves a specific extension registered in the ActorSystem by its unique ID.
A good example can be found .