Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 959 Bytes

File metadata and controls

26 lines (20 loc) · 959 Bytes

Transactional Outbox

A transactional outbox pattern implementation for MSSQL and Postgres

Overview

The implementation of Transactional Outbox pattern for KafkaFlow.

The idea of this library is to be able to "wrap" a producer with an Outbox decorator. This way all the existing producer middlewares (serialisation, etc.) would apply, but the messages would be sent to the Outbox instead of being pushed to Kafka immediately upon publishing.

Here is how Outbox can be enabled when configuring a KafkaFlow producer:

services
    .AddInMemoryOutboxBackend() // configure the backend
    .AddKafka(kafka =>
        kafka.AddCluster(cluster =>
            cluster
                .AddProducer<IMyProducer>(producer =>
                    producer
                        .AddMiddlewares(m => m.AddSerializer<JsonCoreSerializer>())
                        .WithOutbox())