DAMA.Software.MySqlOutbox
2.0.0
dotnet add package DAMA.Software.MySqlOutbox --version 2.0.0
NuGet\Install-Package DAMA.Software.MySqlOutbox -Version 2.0.0
<PackageReference Include="DAMA.Software.MySqlOutbox" Version="2.0.0" />
<PackageVersion Include="DAMA.Software.MySqlOutbox" Version="2.0.0" />
<PackageReference Include="DAMA.Software.MySqlOutbox" />
paket add DAMA.Software.MySqlOutbox --version 2.0.0
#r "nuget: DAMA.Software.MySqlOutbox, 2.0.0"
#:package DAMA.Software.MySqlOutbox@2.0.0
#addin nuget:?package=DAMA.Software.MySqlOutbox&version=2.0.0
#tool nuget:?package=DAMA.Software.MySqlOutbox&version=2.0.0
DAMA.Software.MySqlOutbox
Helpers for the transactional Outbox pattern on MySQL. Extracted from duplicated code in the DAMA Auth and Payment services and published as a NuGet package so every backend that needs an outbox table can consume the same lease / failure recording logic.
What it provides
IOutboxEvent— interface implemented by every outbox-row entity. RequiresId(Guid),OccurredAt(DateTime) and a settableAttempts(int).OutboxLeaseDescriptor<TEvent>— record that tells the helper how to read a particular outbox table: table name, SELECT columns, pending predicate, and a mapper fromMySqlDataReadertoTEvent.MySqlOutboxLeaseHelper.LeaseAsync<TEvent>(...)— runs theSELECT ... FOR UPDATE SKIP LOCKED+UPDATE LeasedUntil/Attemptscycle in a single transaction and returns the leased events.MySqlOutboxLeaseHelper.RecordFailureAsync(...)— clears the lease and stores the last error on a row.
Why it exists
Every DAMA outbox table shares the same lease semantics: pick up to N pending rows that nobody is currently leasing, claim them for a few seconds, and let a worker publish them. The schemas around them (column names, additional state columns, terminal transitions) differ by service, but the lease cycle does not. This package owns that lease cycle so it does not have to be copy-pasted across services.
Requirements on the consumer table
Every outbox table must have, at minimum, columns named:
Id(Guid / CHAR(36))OccurredAt(DATETIME / TIMESTAMP)Attempts(INT)LeasedUntil(DATETIME, nullable)LastError(VARCHAR / TEXT, nullable)
Other columns are free; the descriptor lets the consumer choose which to project.
Example
See OutboxEventDao in the DAMA Auth service and PaymentOutboxDao in the DAMA Payment service for production usage.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- DAMA.Software.MySqlUnitOfWork (>= 2.0.0)
- JuanCarlosHS.SQLDaosPackage (>= 3.1.0)
- MySql.Data (>= 9.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.