LiteBus
CatalogSaga

Saga Capability Catalog

LiteBus saga support is an Extension tier feature. It adds correlated state persistence around inbox command dispatch through IProcessorEnvelopeHook and ISagaContext.

Saga registration is composed from the inbox axis. There is no public top-level AddSagaModule(...) API in v6. Register saga through builder.AddInbox(inbox => inbox.EnableSaga(...)) and select exactly one store in the saga callback.

Lifecycle

Accept correlated inbox command
  -> lease inbox envelope
  -> SagaProcessorHook.BeforeDispatchAsync (load state)
  -> SagaProcessorHook.PrepareDispatchScope (attach message scope)
  -> in-process command dispatch
  -> SagaInboxCommandScopePreHandler (nested scope re-attach)
  -> ICommandHandler<TCommand> uses ISagaContext
  -> SagaProcessorHook.AfterDispatchAsync (save or complete)
  -> inbox terminal status persistence

Package Map

PackageRoleWhy it exists
LiteBus.DurableMessaging.AbstractionsDurable contractsHook contract (IProcessorEnvelopeHook, IProcessorEnvelope) shared by inbox and outbox processors
LiteBus.Saga.AbstractionsDurable contractsSaga contracts (ISagaStore, ISagaContext, SagaCorrelation, query and purge filters)
LiteBus.SagaCore implementationSaga runtime, nested builder, and explicit in-memory storage module
LiteBus.Saga.InboxIntegrationFeature bridgeInbox builder entry point (EnableSaga) and command pre-handler module
LiteBus.Saga.Storage.PostgreSqlFeature bridgePostgreSQL ISagaStore, schema scripts, startup initializer

Typical Composition Recipe

services.AddLiteBus(builder =>
{
    builder.AddMessaging(_ => { });
    builder.AddInbox(inbox =>
    {
        inbox.Contracts.Register<AdvanceOrderSagaCommand>("orders.saga.advance");
        inbox.UseInProcessDispatch();
        inbox.EnableSaga(saga =>
        {
            saga.MapState<OrderSagaState>("orders.saga.advance");
            saga.UseInMemoryStorage();
        });
    });
});

Capability Pages

IDPage
saga.processor-envelope-hooksprocessor-envelope-hooks
saga.processor-hookprocessor-hook
saga.handler-contexthandler-context
saga.state-registrationstate-registration
saga.inbox-integrationinbox-integration
saga.inbox-command-scopeinbox-command-scope
saga.correlation-and-tenancycorrelation-and-tenancy
saga.storestore
saga.in-memory-storein-memory-store
saga.postgresql-storagepostgresql-storage
saga.optimistic-concurrencyoptimistic-concurrency

Test Executor Summary

Test executorProject and pathCoverage focus
Unittests/LiteBus.Storage.UnitTests/Saga/Hook phases, same-correlation scope isolation, registry resolution, in-memory concurrency, query, purge, and schema bootstrap
Integrationtests/LiteBus.Storage.IntegrationTests/PostgreSql/End-to-end inbox plus saga plus PostgreSQL, orchestration depth, compensation, optimistic concurrency, connection ownership
Composition smoketests/LiteBus.Runtime.UnitTests/Runtime/Composition/v6 composition wiring (EnableSaga) and correlated state persistence

Key Gaps Documented

GapStatus in v6
Outbox saga supportNot implemented
Single transaction for inbox terminal plus saga saveNot implemented
Built-in scheduler, timeout orchestration, compensation DSLNot implemented
EF Core saga store adapterNot implemented
Saga-specific metrics and activity sourceNot implemented
Automatic correlation id generationNot implemented
Saga metrics and tracingUse inbox processor signals; no saga-specific instruments in v6

Deep Docs

On this page