https://github.com/rebus-org/rebus.transactionscopes
:bus: System.Transactions.TransactionScope enlistment helper for Rebus
https://github.com/rebus-org/rebus.transactionscopes
rebus transactions
Last synced: 27 days ago
JSON representation
:bus: System.Transactions.TransactionScope enlistment helper for Rebus
- Host: GitHub
- URL: https://github.com/rebus-org/rebus.transactionscopes
- Owner: rebus-org
- License: other
- Created: 2016-08-31T10:03:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T21:28:33.000Z (about 1 year ago)
- Last Synced: 2025-04-02T20:11:51.776Z (about 2 months ago)
- Topics: rebus, transactions
- Language: C#
- Homepage: https://mookid.dk/category/rebus
- Size: 2.96 MB
- Stars: 9
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Rebus.TransactionScopes
[](https://www.nuget.org/packages/Rebus.TransactionScopes)
Provides a `System.Transactions.TransactionScope` helper for [Rebus](https://github.com/rebus-org/Rebus).

---
Use it like this when you send/publish things from anywhere besides inside Rebus handlers:
using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
scope.EnlistRebus();// this one is automatically enlisted in the ambient .NET transaction
await _bus.Send("ostemad");scope.Complete();
}Use it like this to have Rebus handlers invoked inside a `TransactionScope`:
Configure.With(...)
.(...)
.Options(o =>
{
o.HandleMessagesInsideTransactionScope();
})
.Start();By default, the transaction scope will use the `IsolationLevel.ReadCommitted` isolation level with a 1 minute timeout. These
values can be configured by passing an instance of `TransactionOptions` to `HandleMessagesInsideTransactionScope`.That's about it.