Compze.Tessaging.Hosting.Testing 0.12.3-alpha

Prefix Reserved
This is a prerelease version of Compze.Tessaging.Hosting.Testing.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Compze.Tessaging.Hosting.Testing --version 0.12.3-alpha
                    
NuGet\Install-Package Compze.Tessaging.Hosting.Testing -Version 0.12.3-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Compze.Tessaging.Hosting.Testing" Version="0.12.3-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Compze.Tessaging.Hosting.Testing" Version="0.12.3-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Compze.Tessaging.Hosting.Testing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Compze.Tessaging.Hosting.Testing --version 0.12.3-alpha
                    
#r "nuget: Compze.Tessaging.Hosting.Testing, 0.12.3-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Compze.Tessaging.Hosting.Testing@0.12.3-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Compze.Tessaging.Hosting.Testing&version=0.12.3-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Compze.Tessaging.Hosting.Testing&version=0.12.3-alpha&prerelease
                    
Install as a Cake Tool

Compze.Tessaging.Hosting.Testing

TestingEndpointHost hosts production endpoint declarations in a test. Each host tracks tessages in flight, uses a private interprocess registry for discovery, and surfaces unobserved background failures when disposed. Its endpoints are built on clones of a shared root.

Host an exactly-once endpoint

This example uses Microsoft DI, PostgreSQL, System.Text.Json and named pipes. Add the corresponding provider packages alongside this package: Compze.DependencyInjection.Microsoft, Compze.Sql.PostgreSql.Testing, Compze.Tessaging.PostgreSql and Compze.Serialization.SystemTextJson.

var builder = new MicrosoftContainerBuilder();
builder.Registrar.PgSqlTestDatabases()
                 .SystemTextJsonTessagingSerializer()
                 .SystemTextJsonTypermediaSerializer();

await using var host = TestingEndpointHost.Create(
   builder, registrar => registrar.NamedPipeEndpointTransport(),
   TestingEndpointHost.DatabaseByEndpointId(PgSqlDomainDatabaseRegistrar.PgSqlDomainDatabase,
                                            PgSqlTessagingRegistrar.PgSqlTessagingSqlLayer));
var backend = host.RegisterEndpoint(new BackendEndpointDeclaration());
await host.StartAsync();

Select the pool on the root before declaring any named database. The production database declaration then draws connection strings from that pool. DatabaseByEndpointId uses the endpoint id as its reservation name. Distinct endpoints get distinct databases, and a restarted endpoint reopens its data for as long as that root lives. Supply a custom configureDomainDatabase binding for endpoints deliberately sharing a database.

Add the SQL layer and serializer of each persistence feature the declaration uses. A best-effort endpoint only needs its transport and serializers. To host over HTTP, use Compze.Tessaging.Transport.AspNetCore and register the chosen DI adapter's child-container host integration on the root.

The builder overload builds and owns the root. Give the host an already built container to keep the root and its databases across host restarts. Dispose it after the last host. Normal host disposal waits for tessages in flight and surfaces background failures. Use DisposeWithoutWaitingForEndpointsToBeAtRestAsync() for a test deliberately leaving work in flight. To wait for discovery among the host's endpoints, call AwaitEndpointsHaveMetEachOtherAsync() after starting.

A pure Typermedia client uses TypermediaClient.Build in its own container, the selected client transport (NamedPipeEndpointTransportClient() or AspNetCoreEndpointTransportClient()), and its own serializer and type mappings. Call ConnectAsync(endpoint.Address!) before navigating.

Installation

dotnet add package Compze.Tessaging.Hosting.Testing

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.12.11-alpha 0 12/5/2026
0.12.10-alpha 0 12/5/2026
0.12.9-alpha 0 12/5/2026
0.12.8-alpha 0 12/5/2026
0.12.7-alpha 0 12/5/2026
0.12.6-alpha 0 12/5/2026
0.12.5-alpha 7 12/5/2026
0.12.4-alpha 21 12/5/2026
0.12.3-alpha 47 12/5/2026
0.12.2-alpha 47 12/5/2026
0.12.1-alpha 48 12/5/2026
0.12.0-alpha 67 12/4/2026
0.11.14-alpha 60 12/4/2026
0.11.13-alpha 51 12/4/2026
0.11.12-alpha 52 12/4/2026
0.11.11-alpha 50 12/4/2026
0.11.10-alpha 67 12/3/2026
0.11.9-alpha 63 12/3/2026
0.11.8-alpha 52 12/3/2026
0.11.7-alpha 54 12/3/2026
Loading failed

- **The README names Compze.Sql.PostgreSql.Testing** for `PgSqlTestDatabases()`, which moved there from Compze.DbPool.PostgreSql.