LiteBus
CatalogDispatch

Inbox InMemory Transport Dispatch

  • ID: dispatch.inbox.inmemory
  • Name: Inbox InMemory transport dispatch
  • Maturity: GA
  • Summary: Publish leased inbox envelopes through in-process channels for tests and local multi-service pipelines without external brokers.

What It Does

AddInMemoryTransport() registers InMemoryTransportModule at the root, and UseInMemoryDispatch registers TransportInboxDispatchModule as its inbox feature bridge. Messages flow through System.Threading.Channels to a logical destination name. This path is used heavily in integration tests to simulate remote dispatch and pair with InMemory ingress.

Packages

PackageRole
LiteBus.Inbox.Dispatch.InMemoryRegistration glue
LiteBus.Inbox.DispatchShared dispatcher
LiteBus.Transport.InMemoryChannel-based transport

Requires

  • dispatch.transport-core
  • transport.inmemory
  • durable-core.inbox

Invariants

  • Thread-safe within one process; not cross-process.
  • Requeue on failed consume re-enqueues on the channel (transport invoker).
  • Same header mapping as broker transports.

Non-Goals

  • Not for production cross-host messaging.
  • Does not survive process restarts.

Public Surface

services.AddLiteBus(litebus =>
{
    litebus.AddInMemoryTransport();

    litebus.AddInbox(inbox =>
    {
        inbox.EnableInboxProcessor();
        inbox.UseInMemoryDispatch(options =>
        {
            options.DefaultDestination = "orders.commands";
        });
    });
});
APIRole
InboxModuleBuilder.UseInMemoryDispatch(Action<TransportInboxDispatcherOptions>? configure = null)Registers inbox transport dispatcher that requires the root in-memory transport
TransportInboxDispatcher.DispatchAsync(InboxEnvelope, CancellationToken)Shared publish logic over in-process channel transport

Observability

SignalDetail
send {destination}Emitted by InMemoryPublisher with destination and route tags
process {destination}Paired ingress/consumer in the same process
litebus.transport.circuit_breaker.*Tag inmemory; standalone breaker registered by InMemory transport
litebus.inbox.processor.*Standard processor metrics

Activities remain available for test assertions even without external OTLP export.

Deep Docs

Test Coverage

Covered

Test methodProject
InboxDispatchExtensions_ShouldRegisterTransportDispatcherLiteBus.Durable.IntegrationTests (Registration/)
ProcessPendingAsync_ShouldPublishLeasedEnvelopeToInMemoryDestinationLiteBus.Durable.IntegrationTests (Dispatch/Inbox/InMemory/)
ProcessPendingAsync_WhenPersistSkippedAfterDispatch_ShouldRedispatchOnRetryLiteBus.Durable.IntegrationTests (Dispatch/Inbox/InMemory/)

Untested

  • Inbox dispatch failure and retry path beyond persist-skipped scenario.
  • Custom route resolver and tenant route strategy branches.
  • Cross-process delivery, which the in-memory adapter does not support.

Out-of-Scope

  • Production cross-host messaging
  • Surviving process restarts

On this page