Skip to main content

Replaying Azure Event Hubs

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.

ClientProtocolSupport
A Kafka client connected to <namespace>.servicebus.windows.net:9093Kafka over TLS, with SASL PLAINRecord, mock and replay, as Kafka
An Azure Event Hubs SDK, such as azure-messaging-eventhubs or Azure.Messaging.EventHubsAMQP 1.0Not supported yet

For more information about Azure Event Hubs, see the Azure Event Hubs documentation, and its guide to the Kafka endpoint.

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 section for Kafka then applies:

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:

{
"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.

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 has the extraction path, the producer code and the Event Hubs settings.

Loading search...