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. |
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
, or CANCELED
).
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

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
Midaz does not manage or create RabbitMQ queues for you. You are responsible for provisioning queues and setting up the correct bindings.