### Example Git Commit Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/CONTRIBUTING.md An example of how to make a git commit with a message. ```git git commit -am"bam!!!11" ``` -------------------------------- ### Basic Outbox Configuration Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Configures the Rebus.SqlServer transactional outbox using the AddRebus extension method. ```csharp services.AddRebus( configure => configure .Transport(t => /* configure your transport here */) .Outbox(o => o.StoreInSqlServer(connectionString, "Outbox")) ); ``` -------------------------------- ### Outbox Usage Outside a Rebus Handler Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Demonstrates how to use the transactional outbox when outside a Rebus handler, managing SQL connection and transaction manually. ```csharp using var connection = new SqlConnection(connectionString); await connection.OpenAsync(); using var transaction = connection.BeginTransaction(); try { using var scope = new RebusTransactionScope(); scope.UseOutbox(connection, transaction); // Perform your database operations using 'connection' and 'transaction' // Send messages using Rebus await bus.Send(new YourMessage()); // Complete the Rebus transaction scope await scope.CompleteAsync(); // Commit your transaction await transaction.CommitAsync(); } catch (Exception ex) { // Handle exceptions await transaction.RollbackAsync(); // Log or rethrow the exception as needed } ``` -------------------------------- ### Outbox Usage Inside a Rebus Handler Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Shows how to use the transactional outbox within a Rebus handler, accessing the connection and transaction from the message context. ```csharp public class YourMessageHandler : IHandleMessages { public async Task Handle(YourMessage message) { var messageContext = MessageContext.Current ?? throw new InvalidOperationException("No message context available."); var transactionContext = messageContext.TransactionContext; var outboxConnection = (OutboxConnection)transactionContext.Items["current-outbox-connection"]; var connection = outboxConnection.SqlConnection; var transaction = outboxConnection.SqlTransaction; // Perform your database operations using 'connection' and 'transaction' // Send messages using Rebus; they will be included in the same transaction await messageContext.Bus.Send(new AnotherMessage()); } } ``` -------------------------------- ### Transport Configuration Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Configures the SQL transport for Rebus, specifying the connection string and the name of the instance's input queue. ```csharp services.AddRebus( configure => configure .Transport(t => t.UseSqlServer(connectionString, "queue-name")) ); ``` -------------------------------- ### Subscription Storage Configuration Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Configures Rebus to store subscriptions in SQL Server, specifying the table name and whether the storage is centralized. ```csharp services.AddRebus( configure => configure .(...) .Subscriptions(t => t.StoreInSqlServer(connectionString, "Subscriptions", isCentralized: true)) ); ``` -------------------------------- ### Timeout Manager Configuration with SQL Server Storage Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Configures a Rebus instance to function as a timeout manager, storing timeouts in SQL Server, while using RabbitMQ as the transport. ```csharp services.AddRebus( configure => configure .Transport(t => t.UseRabbitMq(connectionString, "timeout_manager")) .Timeouts(t => t.StoreInSqlServer(connectionString, "Timeouts")) ); ``` -------------------------------- ### Saga Storage Configuration Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Configures Rebus to store sagas in SQL Server, specifying the tables for saga data and correlation properties. ```csharp services.AddRebus( configure => configure .(...) .Sagas(t => t.StoreInSqlServer(connectionString, "Sagas", "SagaIndex")) ); ``` -------------------------------- ### External Timeout Manager Configuration Source: https://github.com/rebus-org/rebus.sqlserver/blob/master/README.md Configures a Rebus instance to use an external timeout manager, specifying the name of the timeout manager's queue. ```csharp services.AddRebus( configure => configure .Transport(t => t.UseRabbitMq(connectionString, "another-eueue")) .Timeouts(t => t.UseExternalTimeoutManager("timeout_manager")) ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.