Code Monkey home page Code Monkey logo

rebus.firebird's Introduction

Rebus.Firebird

install from nuget

Currently Provides only a FirebirdSQL-based outbox persistence for Rebus

Configuration

Configure.With(...)
	.Transport(...)
	...
	.Outbox(o => o.StoreInFirebird(ConnectionString, sender: "sender", tableName: "rebus_oubox"))

The sender parameter is used to identify the sender of the message in the outbox. This is useful when multiple senders are using the same outbox table. The Firebird outbox storage will create an Index on the sender column to speed up the lookup of messages in the outbox. The Index will be named IX_{tableName}_sender where {tableName} is the name of the outbox table. So be sure to:

  • use a unique sender name for each sender
  • follow the Firebird naming rules for identifiers (before v4.0: 31 characters, since v4.0: 63 characters)

Usage

Outside of a Rebus handler: start a database transaction and use the RebusTransactionScope with UseOutbox to use the outbox. Example:

await using FbConnection connection = new(ConnectionString);
await connection.OpenAsync();
await using FbTransaction transaction = await connection.BeginTransactionAsync();

// this is how we would use the outbox for outgoing messages
using RebusTransactionScope scope = new();
scope.UseOutbox(connection, transaction);

await bus.Send(new SomeMessage());

await scope.CompleteAsync();
await transaction.CommitAsync();

Inside a Rebus handler: nothing special to do, the outbox will be used automatically

Reporting

You can pass an Implementation of IReportOutboxOperations to the Outbox configuration to get reports about the outbox operations. The Interface IReportOutboxOperations has 6 methods:

  • void ReportChecking(); // called when the outbox is checked for pending messages
  • void ReportNoPendingMessages(); // called when no pending messages are found in the outbox
  • void ReportSending(int count); // called when messages are sent from the outbox
  • void ReportRetrying(int attempt); // called when a sending a message is retried
  • void ReportSendingFailed(int count); // called when sending messages from the outbox failed
  • void ReportSent(int count); // called when messages are successfully sent from the outbox

rebus.firebird's People

Contributors

amroel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.