Skip to main content

Why this matters


Event publishing lets your systems react to transactions the moment they happen — trigger customer notifications, sync your ERP, feed analytics dashboards, or kick off compliance workflows. All of this without tightly coupling your systems together. The sections below cover the technical setup. For a business-oriented overview, see About Midaz.

Enabling transaction events


Transaction event publication is enabled by default — Midaz treats the flag as enabled unless it is explicitly set to false. The bundled example configuration ships it set to false, so on a stack started from that example, make sure the flag is not set to false (or set it to true) in the transaction application:
With the flag left enabled, Midaz publishes events to the following exchange in RabbitMQ:

Event types


Midaz emits one of the following event types depending on the transaction lifecycle:

Example event payload


The full payload includes timestamps, balance snapshots, and other identifiers used for auditing and traceability.

Event routing model


To ensure flexibility and scalability, Midaz uses a topic exchange to publish messages instead of sending them directly to specific queues. This means you control which events to receive by configuring your own bindings.

How routing works

Each event published by Midaz is tagged with a routingKey using the format:
Where <status> corresponds to the current transaction status (APPROVED, PENDING, CANCELED, CREATED, or NOTED). To consume events, your application must:
1
Create a queue in RabbitMQ.
2
Bind your queue to the Midaz exchange using the routingKey pattern that matches your interest.

Visual overview

Midaz event routing model, showing how published events reach subscriber queues bound to the exchange by routing-key patterns

Figure 1. Visual representation of the event routing model.

You can configure multiple queues with different bindings to serve specific teams or services independently.

Queue and binding example


Creating a new queue

Binding the queue to receive all events

The wildcard * matches all five statuses: APPROVED, PENDING, CANCELED, CREATED, and NOTED. To subscribe to specific events only, replace the wildcard with the exact status — for example, midaz.transaction.NOTED to receive only annotation events.
Midaz does not manage or create RabbitMQ queues for you. You are responsible for provisioning queues and setting up the correct bindings.