Compze.Tessaging.Hosting.Testing
0.11.13-alpha
Prefix Reserved
See the version list below for details.
dotnet add package Compze.Tessaging.Hosting.Testing --version 0.11.13-alpha
NuGet\Install-Package Compze.Tessaging.Hosting.Testing -Version 0.11.13-alpha
<PackageReference Include="Compze.Tessaging.Hosting.Testing" Version="0.11.13-alpha" />
<PackageVersion Include="Compze.Tessaging.Hosting.Testing" Version="0.11.13-alpha" />
<PackageReference Include="Compze.Tessaging.Hosting.Testing" />
paket add Compze.Tessaging.Hosting.Testing --version 0.11.13-alpha
#r "nuget: Compze.Tessaging.Hosting.Testing, 0.11.13-alpha"
#:package Compze.Tessaging.Hosting.Testing@0.11.13-alpha
#addin nuget:?package=Compze.Tessaging.Hosting.Testing&version=0.11.13-alpha&prerelease
#tool nuget:?package=Compze.Tessaging.Hosting.Testing&version=0.11.13-alpha&prerelease
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.DbPool.PostgreSql, 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Compze.DependencyInjection (>= 0.13.0-alpha)
- Compze.Hosting (= 0.10.4-alpha)
- Compze.Internals.SystemCE (>= 0.18.0-internal)
- Compze.Tessaging (= 0.25.1-alpha)
- Compze.Threading (>= 0.16.0-alpha)
- Compze.Underscore (>= 0.6.0-beta)
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 |
- **Requires exact versions of the Compze packages whose internals it uses:** Compze.Hosting 0.10.4-alpha (was 0.10.3-alpha), Compze.Tessaging 0.25.1-alpha (was 0.25.0-alpha). Upgrading to this version upgrades each package listed here to exactly that version, so their changelogs apply to this upgrade as well.