This article introduces the implementation of the outbox pattern with PostgreSQL in Brighter to ensure transactional consistency between database updates and message publishing using .NET 8, Brighter, and PostgreSQL.
The project involves sending commands to create orders and sending messages (OrderPlaced & OrderPaid) based on the outcome, while ensuring no messages are sent in case of failures.
Requirements include .NET 8+, Podman (or Docker) for running local containers with PostgreSQL and RabbitMQ, and specific NuGet packages for Brighter and RabbitMQ integration.
The implementation involves message creation, mappers for events, request handlers for logging messages, the creation of new orders with handling of success and failure scenarios, and configuring PostgreSQL for the outbox pattern with limitations and future improvements mentioned.