.NET library for distributed transactions and an event bus with the outbox pattern
open sourceMITfree
CAP (DotNetCore.CAP) is a .NET library that keeps events between microservices from getting lost: it writes each event to a local message table in the same database transaction as your data (the outbox pattern), then publishes it to a message queue with retries. It also works as a standalone event bus, with delayed messages, consumer groups, wildcard subscriptions, a web dashboard and OpenTelemetry tracing, over RabbitMQ, Kafka, Azure Service Bus, Amazon SQS, NATS, Redis Streams or Pulsar, storing its table in SQL Server, MySQL, PostgreSQL or MongoDB.
Problems it solves
- make sure events between my .NET microservices aren't lost when the message broker or a service fails
- publish an event only if my database transaction commits
- add an event bus to my ASP.NET Core app without writing the plumbing myself
Features
- transactional outbox through a local message table in your own database
- guaranteed delivery with automatic retries
- delayed messages without broker support
- consumer groups, fan-out and wildcard topic subscriptions
- built-in web dashboard to monitor and retry messages
- OpenTelemetry tracing and Consul or Kubernetes node discovery