---
title: "Replaying Azure Event Hubs | Speedscale Docs"
description: "Record, mock and replay Azure Event Hubs traffic through its Kafka endpoint with Speedscale and proxymock. The Event Hubs AMQP clients are not supported yet."
canonical: "https://docs.speedscale.com/guides/message-brokers/azure-event-hubs/"
---

[Documentation index](https://docs.speedscale.com/guides/llms.txt) | [Markdown](https://docs.speedscale.com/guides/message-brokers/azure-event-hubs/index.md) | [Canonical page](https://docs.speedscale.com/guides/message-brokers/azure-event-hubs/)

# Replaying Azure Event Hubs

<a id="background"></a>

## Background

Azure Event Hubs has two ways in: a Kafka-compatible endpoint on port 9093, and AMQP 1.0, which the Azure Event Hubs SDKs use. Speedscale supports the Kafka endpoint, as Kafka. AMQP 1.0 is not supported yet.

| Client | Protocol | Support |
| --- | --- | --- |
| A Kafka client connected to `<namespace>.servicebus.windows.net:9093` | Kafka over TLS, with SASL PLAIN | Record, mock and replay, as [Kafka](https://docs.speedscale.com/guides/message-brokers/kafka/) |
| An Azure Event Hubs SDK, such as `azure-messaging-eventhubs` or `Azure.Messaging.EventHubs` | AMQP 1.0 | Not supported yet |

For more information about Azure Event Hubs, see the [Azure Event Hubs documentation](https://azure.microsoft.com/en-us/products/event-hubs), and its guide to the [Kafka endpoint](https://learn.microsoft.com/azure/event-hubs/azure-event-hubs-kafka-overview).

<a id="use-the-kafka-endpoint"></a>

## Use the Kafka endpoint

Port 9093 is one of the ports Speedscale recognizes as Kafka, so a Kafka client's traffic to Event Hubs is recorded as Kafka once its TLS is decrypted: by the sidecar's TLS interception or the eBPF collector in a cluster. Everything in the proxymock [message brokers](https://docs.speedscale.com/proxymock/message-brokers/) section for Kafka then applies:

*   [Record Kafka traffic](https://docs.speedscale.com/proxymock/message-brokers/record/kafka/#in-a-cluster)
*   [Mock a broker](https://docs.speedscale.com/proxymock/message-brokers/mock-a-broker/#kafka). The mock accepts SASL PLAIN with any credentials, so your app keeps its connection string.
*   [Test a consumer](https://docs.speedscale.com/proxymock/message-brokers/test-a-consumer/#kafka), and the [Kafka guide](https://docs.speedscale.com/guides/message-brokers/kafka/) for a replay in your cluster

A replay that produces to Event Hubs authenticates the way Kafka clients do with Event Hubs: SASL PLAIN, the username `$ConnectionString`, and the namespace's connection string, from **Shared access policies** in the Azure portal, as the password. Keep the connection string in a secret:

```json
{
  "generator": {
    "kafka": {
      "username": "$ConnectionString",
      "password": "${{secret:event-hubs/connection-string}}",
      "saslMechanism": "PROTOCOL_SASL_MECHANISM_PLAIN",
      "tlsMode": "PROTOCOL_TLS_MODE_VERIFY_FULL"
    }
  }
}
```

The event hub's name is the Kafka topic. See [Connect to the broker](https://docs.speedscale.com/proxymock/message-brokers/connect-to-the-broker/#kafka).

<a id="write-your-own-load-driver"></a>

## Write your own load driver

To publish recorded records to Event Hubs yourself, extract them from a snapshot and send them with a Kafka producer. [Write your own load driver](https://docs.speedscale.com/proxymock/message-brokers/write-your-own-load-driver/#kafka) has the extraction path, the producer code and the Event Hubs settings.
