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
To activate this feature, set the following environment variable in the transaction application:
Event types
Midaz emits one of the following event types depending on the transaction lifecycle:
| Action | Description |
|---|---|
APPROVED | The transaction was successfully completed. This includes single-step transactions and two-phase transactions that have been committed. |
PENDING | A two-phase transaction was created and is waiting for either a commit or cancellation. |
CANCELED | A two-phase transaction was canceled before confirmation. |
CREATED | A reversal transaction was initiated. This is a transient status that progresses to APPROVED once processing completes. |
NOTED | An annotation transaction was recorded. The transaction is logged in the ledger without affecting account balances. |
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:<status> corresponds to the current transaction status (APPROVED, PENDING, CANCELED, CREATED, or NOTED).
To consume events, your application must:
Visual overview

Queue and binding example
Creating a new queue
Binding the queue to receive all events
* 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.

