Edit

Share via


Quickstart: Send and receive large messages with Azure Event Hubs (preview)

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

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.

Screenshot that shows the Quota pane for a dedicated cluster.

  • 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 to True.

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.