# Event Streaming

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

Stack: v4.0

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}
```

In Stack v4.0, Ledger delivers its events through event sinks, which you configure per destination: a broker, a webhook, or an analytical store. See [Configure an Event Sink](https://docs.formance.com/v4.0/modules/ledger/events/configure-sink).

## 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/v4.0/deploy/self-hosted/infrastructure/message-broker).
