Skip to content
aaronontheweb avatar

Akka Hosting Actor Patterns

Patterns for entity actors with Akka.Hosting that run unchanged in local tests or clustered production.

CCM score
67 of 100
skills.sh installs
455
GitHub stars
1.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers entity actor setup with GenericChildPerEntityParent for local mode and cluster sharding for production
  • Includes message extractors, WithOrderActor-style hosting extensions, ITimeProvider wiring via the ActorSystem Scheduler, and akka-reminders
  • Enforces an AkkaExecutionMode switch so the same actor code runs with or without clustering
  • Designed for .NET teams building domain entity actors that need both unit testing and clustered deployment

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Akka.Hosting Actor Patterns

When to Use This Skill

Use this skill when:

  • Building entity actors that represent domain objects (users, orders, invoices, etc.)
  • Need actors that work in both unit tests (no clustering) and production (cluster sharding)
  • Setting up scheduled tasks with akka-reminders
  • Registering actors with Akka.Hosting extension methods
  • Creating reusable actor configuration patterns

Core Principles

  1. Execution Mode Abstraction - Same actor code runs locally (tests) or clustered (production)
  2. GenericChildPerEntityParent for Local - Mimics sharding semantics without cluster overhead
  3. Message Extractors for Routing - Reuse Akka.Cluster.Sharding's IMessageExtractor interface
  4. Akka.Hosting Extension Methods - Fluent configuration that composes well
  5. ITimeProvider for Testability - Use ActorSystem.Scheduler instead of DateTime.Now

Execution Modes

Define an enum to control actor behavior:

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
.NET & C#, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the akka-hosting-actor-patterns skill do?

akka-hosting-actor-patterns teaches patterns for building entity actors with Akka.Hosting, including GenericChildPerEntityParent, message extractors, cluster sharding abstraction, akka-reminders, and ITimeProvider. It lets the same actor code run in local tests or in clustered production mode.

How do I install the akka-hosting-actor-patterns skill?

Run npx -y skills add aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -y in a project to install it. Once installed, akka-hosting-actor-patterns gives the agent Akka.NET actor templates it can apply to entity actors in your project.

Who should use the akka-hosting-actor-patterns skill?

akka-hosting-actor-patterns is for .NET developers who build entity actors for domain objects such as users, orders or invoices. It also suits developers who need actors that work in both unit tests without clustering and in production with cluster sharding.

Where does akka-hosting-actor-patterns fit among .NET & C# skills?

akka-hosting-actor-patterns sits in the .NET & C# category, where dotnet-backend-patterns and dotnet-best-practices lead the list. Its own focus is Akka.Hosting entity actors that run in both local and clustered modes.

More from aaronontheweb/dotnet-skills

All 34

Similar to Akka Hosting Actor Patterns

More .NET & C#