akka-hosting-actor-patterns

Host Akka.NET actors in local and clustered production environments.

1.1k|101|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: akka-hosting-actor-patterns
Source: https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/akka-hosting-actor-patterns
Command: npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides patterns and tooling to host Akka.NET actors in both local test environments and clustered production, reducing boilerplate and improving testability.

Core Features & Use Cases

  • Generic child-per-entity parent for local testing that mimics cluster semantics without heavy overhead.
  • Message extractors using Akka.Cluster.Sharding interfaces for consistent routing.
  • Akka.Hosting extension methods for fluent configuration across local and cluster modes.
  • ITimeProvider integration to enable testable time-based logic via the ActorSystem.Scheduler.
  • Akka.Reminders integration to schedule durable tasks with both in-memory and SQL storage options.
  • Marker types for registry to reference parent shards and singleton actors clearly.
  • Scoped DI per message pattern to ensure fresh DbContext or scoped services during message handling.

Quick Start

Configure hosting with execution mode appropriate for your environment, then resolve actors through the registry or use the provided extension methods to wire up domain actors and optional reminders. For example, in startup code, call WithOrderDomainActors(executionMode) and register TimeProvider in the DI container. Then send messages to your actors to verify behavior.

Frequently Asked Questions about akka-hosting-actor-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Akka.NET cluster sharding locally without running a full cluster?

To test Akka.NET cluster sharding locally, you can use the GenericChildPerEntityParent pattern to mimic cluster semantics in local testing without the heavy overhead of a real cluster environment.

How do I configure Akka.Hosting extension methods for actors and reminders?

You configure Akka.Hosting by calling domain-specific extension methods like WithOrderDomainActors with an execution mode, then register the TimeProvider in the DI container to wire up actors and durable reminders.

Can I use dependency injection to scope fresh DbContext instances per Akka.NET message?

Yes, you can use the scoped DI per message pattern to ensure fresh DbContext or scoped services are created during message handling in Akka.NET actors.

How does Akka.Reminders integrate with in-memory and SQL storage for durable scheduling?

Akka.Reminders integrates to schedule durable tasks by supporting both in-memory storage for local testing and SQL storage options for clustered production environments.

Does Akka.Hosting support ITimeProvider integration for testable time-based actor logic?

Yes, Akka.Hosting supports ITimeProvider integration to enable testable time-based logic via the ActorSystem.Scheduler by registering the TimeProvider in the DI container.

What is the best way to route messages consistently using Akka.Cluster.Sharding message extractors?

The best way to route messages consistently is by using message extractors that implement Akka.Cluster.Sharding interfaces for consistent routing across local and cluster modes.