Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this quickstart, you learn how to send and receive large messages (up to 20 MB) by using Azure Event Hubs. If you're new to Event Hubs, see Event Hubs overview before you begin.
Prerequisites
- An Azure subscription. To use Azure services, including Event Hubs, you need a subscription. If you don't have an Azure account, you can sign up for a free trial or activate your Monthly Azure credits for Visual Studio subscribers.
- A self-serve scalable dedicated cluster, an Event Hubs namespace, and an event hub. Use the Azure portal to create a dedicated cluster and namespace inside a cluster. To create an event hub, see Quickstart: Create an event hub by using the Azure portal. You can skip this step if you already have a self-serve scalable dedicated cluster.
Note
Large message support is currently in public preview. It's exclusively available with certain Event Hubs self-serve dedicated clusters. Streaming large messages with these clusters incurs no extra charges.
Configure an Event Hubs dedicated cluster
To stream large messages, you must configure your self-serve scalable dedicated cluster.
In the Azure portal, go to the Settings section for the dedicated cluster. Under Settings, select the Quota tab.
- You can update the key
eventhubmaxmessagesizeinbytes
to a suitable value in bytes. An acceptable range for this value is between 1,048,576 and 20,971,520 bytes. - Validate that the value for the read-only key
supportslargemessages
is set toTrue
.
After you save the configuration, you're ready to stream large messages with Event Hubs.
Important
Large message streaming is only supported with self-serve scalable dedicated clusters built out of the latest infrastructure. The Supportslargemessages
key reflects this capability.
If a cluster value is false, it doesn't support large message streaming. To enable this feature, you must re-create the cluster.
Stream large messages with Event Hubs
Event Hubs allows streaming of large messages up to 20 MB, both in batches and as individual publications. The ability to stream large messages or events requires no client code changes apart from the change in the message or event itself. You can continue to send or receive messages by using any existing Event Hubs SDK or Kafka API to stream large messages to Event Hubs. This way you can stream large messages to Event Hubs in the same manner as you would for messages of sizes less than 1 MB.
For more information, see Send events to and receive events from Event Hubs by using .NET.
Tip
Make sure to review any Event Hubs Advanced Message Queuing Protocol (AMQP) client or Kafka client configuration that might limit the maximum message size that you stream into Event Hubs. You must update client timeout to a higher value to stream large messages.
By default, the AMQP client prefetch count is 300. Lower this value to avoid client-side memory issues when you deal with large messages.
For the complete SDK reference, see Azure Event Hubs libraries for .NET.