// AKKA.HOSTING

Logging, HealthChecks, Configuration, DI, and Hosting
All Built Into Akka.NET

Akka.Hosting integrates Akka.NET directly with Microsoft.Extensions. DI, IHostedService lifecycle, structured logging, health checks, and strongly-typed configuration — all work out of the box. No boilerplate, no separate config files.

ref: features

// KEY_CAPABILITIES

Hosting Features

Dependency Injection

First-class IServiceProvider integration. Inject actors via IRequiredActor<T> and resolve services inside actors using DependencyResolver. No more service locator patterns.

ActorRegistry

Typed key registry for actor resolution via DI. Register actors during startup, resolve them anywhere in your application. Type-safe, no magic strings.

IHostedService Lifecycle

ActorSystem lifecycle automatically tied to the .NET host. Starts with your app, shuts down gracefully. Integrates with Microsoft.Extensions.Logging for OpenTelemetry compatibility.

Composable Builder Pattern

Fluent API extends to Remote, Cluster, Persistence, and Sharding via NuGet extension packages. Organize configuration into composable Add* extension methods.

ref: example

// JUST_ADD_AKKA

Integrates Like Any Other .NET Service

AddAkka() plugs into IServiceCollection just like EF Core, SignalR, or any other .NET library. Inject actors into your endpoints with IRequiredActor<T>. Read the full walkthrough →

Program.cs
var builder = WebApplication.CreateBuilder(args);

// Add Akka.NET to your ASP.NET Core app — just like any other service
builder.Services.AddAkka("MyActorSystem", configurationBuilder =>
{
    configurationBuilder
        .WithRemoting("localhost", 8110)
        .WithClustering(new ClusterOptions { Roles = ["web"] })
        .WithActors((system, registry) =>
        {
            var echo = system.ActorOf(Props.Create<EchoActor>());
            registry.Register<Echo>(echo);  // register for DI
        });
});

var app = builder.Build();

// Inject actors into endpoints — just like any other dependency
app.MapGet("/", async (IRequiredActor<Echo> echo) =>
    await echo.ActorRef.Ask<string>("hello"));

app.Run();
ref: packages

// NUGET_PACKAGES

ref: learn

// LEARN_MORE

ref: newsletter

// STAY_CONNECTED