AsyncMonolith.TestHelpers
11.0.0
dotnet add package AsyncMonolith.TestHelpers --version 11.0.0
NuGet\Install-Package AsyncMonolith.TestHelpers -Version 11.0.0
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="AsyncMonolith.TestHelpers" Version="11.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AsyncMonolith.TestHelpers" Version="11.0.0" />
<PackageReference Include="AsyncMonolith.TestHelpers" />
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 AsyncMonolith.TestHelpers --version 11.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AsyncMonolith.TestHelpers, 11.0.0"
#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 AsyncMonolith.TestHelpers@11.0.0
#: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=AsyncMonolith.TestHelpers&version=11.0.0
#tool nuget:?package=AsyncMonolith.TestHelpers&version=11.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AsyncMonolith
Background messaging and scheduling for .NET monoliths, using the database you already have through Entity Framework Core.
- Transactional outbox: messages are written in the same
SaveChangesas your data, so they are never lost or sent for changes that rolled back. - Consumers run in the background with timeouts, retries with exponential backoff, and poisoned message handling.
- Schedules: recurring messages from cron expressions in any time zone.
- Safe with several app instances, with metrics on the
async_monolithmeter.
Databases
One package works with any EF Core provider and picks its queries from the one you use:
| Provider | Row locking |
|---|---|
PostgreSQL (Npgsql.EntityFrameworkCore.PostgreSQL) |
FOR UPDATE SKIP LOCKED |
SQL Server (Microsoft.EntityFrameworkCore.SqlServer) |
UPDLOCK, READPAST |
MySQL / MariaDB (MySql.EntityFrameworkCore or Pomelo) |
FOR UPDATE SKIP LOCKED |
| Anything else, such as SQLite | None: fine for a single instance |
AsyncMonolith.TestHelpers adds fakes and helpers for testing consumers with xunit v3.
Quick start
builder.Services.AddAsyncMonolith<AppDbContext>(o => o.RegisterTypesFromAssemblyContaining<Program>());
// In AppDbContext.OnModelCreating
modelBuilder.ConfigureAsyncMonolith();
public record OrderPlaced(int OrderId) : IConsumerPayload;
public class SendReceipt : IConsumer<OrderPlaced>
{
public Task Consume(OrderPlaced payload, ConsumeContext context, CancellationToken cancellationToken) => ...;
}
await producer.Produce(new OrderPlaced(order.Id));
await dbContext.SaveChangesAsync();
Documentation: https://timmoth.github.io/AsyncMonolith/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- AsyncMonolith (>= 11.0.0)
- Cronos (>= 0.13.0)
- MartinCostello.Logging.XUnit.v3 (>= 0.7.1)
- Microsoft.EntityFrameworkCore (>= 10.0.15)
- Microsoft.Extensions.TimeProvider.Testing (>= 10.11.0)
- xunit.v3.assert (>= 4.0.3)
- xunit.v3.extensibility.core (>= 4.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.