# dotnetcore/CAP

Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern

Repository: https://github.com/dotnetcore/CAP
Canonical: https://ross.abutalabs.com/products/dotnetcore-cap
Homepage: http://cap.dotnetcore.xyz
Language: C#
License: MIT
License Family: permissive
Topics: kafka, rabbitmq, distributed-transactions, outbox-pattern, eventbus, microservices, service-bus
Last push: 2026-08-01T13:10:06+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 95, release rhythm 83, longevity 100
- inputs: {"age_days": 3549, "days_push": 32, "days_rel": 32, "gap_med": 43.0, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7107, forks 1337 (observed 2026-08-28T04:09:55.937173+00:00)

## What it is
CAP is a .NET library providing a lightweight event bus and a distributed transaction solution based on the Outbox pattern (local message table) for eventual consistency in microservices. It guarantees reliable event delivery with automatic retries and integrates with message queues like Kafka and RabbitMQ.

## Use cases
- ensure atomicity between database writes and event publishing in microservices
- implement outbox pattern for reliable event delivery
- decouple microservices with a lightweight event bus
- publish delayed messages without relying on broker features
- achieve eventual consistency across services in a SOA system
- implement competing consumers and fan-out messaging patterns

## When to choose
- you're building .NET/ASP.NET Core microservices needing reliable event publishing tied to database transactions
- you want an event bus with no interface inheritance requirements and minimal configuration
- you need guaranteed message delivery with retries and a local message table
- you want pluggable message queue and storage backends (Kafka, RabbitMQ, MySQL, etc.)

## When to avoid
- you need a standalone message queue without database-backed storage - CAP requires a database for its outbox
- you need immediate rollback of producer-side SQL when consumers fail - CAP only offers eventual consistency
- your stack is not .NET - CAP is a .NET Standard library
- you need strict synchronous distributed transactions (e.g., 2PC) rather than eventual consistency

## Facets
- artifact type: library
- maturity: active
- function: message-queue, middleware, microservices, serialization
- domain: microservices, backend, apis
- platform: dotnet, cross-platform, cloud
- tags: eventbus, outbox-pattern, distributed-transactions, eventual-consistency, kafka, rabbitmq, local-message-table, aspnet-core, reliable-messaging, delayed-messages, messaging, docker

## Member repositories
- dotnetcore/CAP (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:55.937173+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:40:07.914844+00:00, confidence not recorded.
  - readme: https://github.com/dotnetcore/CAP (fetched 2026-08-28T04:09:55.937173+00:00, sha 06cfec53f373)
  - homepage: http://cap.dotnetcore.xyz (fetched 2026-08-29T08:35:58.696511+00:00, sha acb09a038e80)
  - site_page: https://cap.dotnetcore.xyz/user-guide/en/getting-started/quick-start (fetched 2026-08-29T08:35:58.699040+00:00, sha d70b44c58e09)
  - site_page: https://cap.dotnetcore.xyz/user-guide/zh/getting-started/quick-start (fetched 2026-08-29T08:35:58.701085+00:00, sha 39f1cee3b026)
  - site_page: https://cap.dotnetcore.xyz/about/contact-us (fetched 2026-08-29T08:35:58.703128+00:00, sha ecfffe00dcea)
  - site_page: https://cap.dotnetcore.xyz/user-guide/en/getting-started/introduction (fetched 2026-08-29T08:35:58.704814+00:00, sha bab42de04ffc)
  - site_page: https://cap.dotnetcore.xyz/user-guide/en/getting-started/contributing (fetched 2026-08-29T08:35:58.706454+00:00, sha 29c083f9ee66)
  - site_page: https://cap.dotnetcore.xyz/user-guide/en/samples/faq (fetched 2026-08-29T08:35:58.707950+00:00, sha 52df2d043cc5)
  - site_page: https://cap.dotnetcore.xyz/user-guide/zh/getting-started/introduction (fetched 2026-08-29T08:35:58.709570+00:00, sha 50f4fa7c2257)
  - site_page: https://cap.dotnetcore.xyz/user-guide/zh/getting-started/contributing (fetched 2026-08-29T08:35:58.711222+00:00, sha b3939e4dc3f0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
