# Event Streaming

Source: https://docs.formance.com/manage/events/streaming

Stack: v3.2

The Formance Platform can stream all platform events to a message broker, giving you a real-time feed of everything happening across your stack. This enables you to build reactive integrations, power audit pipelines, or feed events into your own data infrastructure.

## Overview

When a broker is configured, every service in the stack publishes events to it. Events are organized into topics in the format:

```
{stackName}-{module}
```

The following services produce events:

| Role      | Services                  |
| --------- | ------------------------- |
| Producers | Ledger, Gateway, Payments |
| Consumers | Orchestration, Webhooks   |

Webhooks are built on top of the event stream — they subscribe to broker topics and forward matching events to your configured endpoints. See [Webhooks](https://docs.formance.com/v3.2/modules/webhooks) for more details.

## Supported brokers

The platform supports two message brokers:

| Broker                             | Requirements                        |
| ---------------------------------- | ----------------------------------- |
| [NATS](https://nats.io/)           | Version 2.6+ with Jetstream enabled |
| [Kafka](https://kafka.apache.org/) | Standard Kafka cluster              |

## Configuration

The broker is configured at the stack level via the `broker.dsn` setting.

NATS

```yaml
apiVersion: formance.com/v1beta1
kind: Settings
metadata:
  name: formance-dev-broker
spec:
  key: broker.dsn
  stacks:
    - "formance-dev"
  value: nats://nats.formance-system.svc:4222?replicas=3
```

Kafka

```yaml
apiVersion: formance.com/v1beta1
kind: Settings
metadata:
  name: formance-dev-broker
spec:
  key: broker.dsn
  stacks:
    - "formance-dev"
  value: kafka://kafka.formance-system.svc:9092
```

For detailed broker setup instructions, see [Message Broker infrastructure](https://docs.formance.com/deploy/self-hosted/infrastructure/message-broker).
