Uredi

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

Configure an Event Hubs dedicated cluster

To stream large messages, configure your dedicated cluster:

  1. In the Azure portal, go to your dedicated cluster.

  2. Under Settings, select the Quota tab.

    Screenshot that shows the Quota pane for a dedicated cluster.

  3. Confirm that the read-only key supportslargemessages is set to True.

  4. Update the eventhubmaxmessagesizeinbytes key to a suitable value in bytes. The acceptable range is between 1,048,576 and 20,971,520 bytes.

  5. Save the configuration. You're now ready to stream large messages with Event Hubs.

Important

Large message streaming is supported only on dedicated clusters that are built on the latest infrastructure. The supportslargemessages key reflects this capability.

If the supportslargemessages value is False, the cluster doesn't support streaming large messages. To enable the feature, re-create the cluster. Streaming large messages doesn't incur any extra charges.

Stream large messages with Event Hubs

Eligible Event Hubs dedicated clusters support streaming large messages up to 20 MB, both in batches and as individual publications. You can use any existing Event Hubs SDK or Kafka API to stream large messages to Event Hubs. For existing connections, restart the clients or re-establish the connection to stream large messages.

Tip

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. Update the client timeout to a higher value (greater than 60 seconds) to stream large messages, and refine it based on your testing results to meet your workload needs.

By default, the AMQP client prefetch count is 300. Lower this value to avoid client-side memory issues when you handle large messages.