Azure Event Hubs Rust SDK

VerifiedSafe

Azure Event Hubs SDK for Rust - send and receive events, stream data ingestion, manage partitions.

Sby Skills Guide Bot
DevelopmentIntermediate
8/13/2026
Claude CodeCursorWindsurfCopilotCodex
#azure#rust#event-hubs#streaming#sdk

Recommended for

Automated summary

Guide to the Azure Event Hubs Rust SDK for sending and receiving events, including batches, partitions, and checkpointing.

Strengths

  • Ready-to-use Rust snippets for ProducerClient and ConsumerClient
  • Covers single sends, batching, and per-partition consumption
  • Notes the Blob checkpoint store for distributed consumers
  • Links to docs.rs, GitHub source, and crates.io

Limitations

  • Does not detail error handling, retries, or reconnection strategies
  • Authentication example is limited to DeveloperToolsCredential
  • No complete distributed checkpointing example
When to use it

Use when building a Rust service that sends or reads Azure Event Hubs events.

When not to use it

Avoid when the project uses another language or SDK, or needs advanced production reliability patterns not covered here.

Security analysis

Safe
Quality score86/100

The skill is a documentation-style guide for the Azure Event Hubs Rust SDK. It contains standard installation, environment variable, producer, consumer, and checkpoint-store examples. There are no destructive commands, credential exfiltration, obfuscated payloads, or instructions to disable safety controls.

No concerns found

How this analysis is made

Examples

Batch telemetry producer
Write a Rust service using azure_messaging_eventhubs that sends telemetry events in batches to an Azure Event Hub, using DeveloperToolsCredential and the EVENTHUBS_HOST and EVENTHUB_NAME environment variables.
Partition consumer
Show how to consume events from partition 0 of an Azure Event Hub in Rust with ConsumerClient and print each event body.
Checkpointing setup
How do I add checkpointing for a distributed Rust Event Hubs consumer using azure_messaging_eventhubs_checkpointstore_blob?

name: azure-eventhub-rust description: Azure Event Hubs SDK for Rust. Use for sending and receiving events, streaming data ingestion. risk: unknown source: community date_added: '2026-02-27'

Azure Event Hubs SDK for Rust

Client library for Azure Event Hubs — big data streaming platform and event ingestion service.

Installation

cargo add azure_messaging_eventhubs azure_identity

Environment Variables

EVENTHUBS_HOST=<namespace>.servicebus.windows.net
EVENTHUB_NAME=<eventhub-name>

Key Concepts

  • Namespace — container for Event Hubs
  • Event Hub — stream of events partitioned for parallel processing
  • Partition — ordered sequence of events
  • Producer — sends events to Event Hub
  • Consumer — receives events from partitions

Producer Client

Create Producer

use azure_identity::DeveloperToolsCredential;
use azure_messaging_eventhubs::ProducerClient;

let credential = DeveloperToolsCredential::new(None)?;
let producer = ProducerClient::builder()
    .open("<namespace>.servicebus.windows.net", "eventhub-name", credential.clone())
    .await?;

Send Single Event

producer.send_event(vec![1, 2, 3, 4], None).await?;

Send Batch

let batch = producer.create_batch(None).await?;
batch.try_add_event_data(b"event 1".to_vec(), None)?;
batch.try_add_event_data(b"event 2".to_vec(), None)?;

producer.send_batch(batch, None).await?;

Consumer Client

Create Consumer

use azure_messaging_eventhubs::ConsumerClient;

let credential = DeveloperToolsCredential::new(None)?;
let consumer = ConsumerClient::builder()
    .open("<namespace>.servicebus.windows.net", "eventhub-name", credential.clone())
    .await?;

Receive Events

// Open receiver for specific partition
let receiver = consumer.open_partition_receiver("0", None).await?;

// Receive events
let events = receiver.receive_events(100, None).await?;
for event in events {
    println!("Event data: {:?}", event.body());
}

Get Event Hub Properties

let properties = consumer.get_eventhub_properties(None).await?;
println!("Partitions: {:?}", properties.partition_ids);

Get Partition Properties

let partition_props = consumer.get_partition_properties("0", None).await?;
println!("Last sequence number: {}", partition_props.last_enqueued_sequence_number);

Best Practices

  1. Reuse clients — create once, send many events
  2. Use batches — more efficient than individual sends
  3. Check batch capacity — try_add_event_data returns false when full
  4. Process partitions in parallel — each partition can be consumed independently
  5. Use consumer groups — isolate different consuming applications
  6. Handle checkpointing — use azure_messaging_eventhubs_checkpointstore_blob for distributed consumers

Checkpoint Store (Optional)

For distributed consumers with checkpointing:

cargo add azure_messaging_eventhubs_checkpointstore_blob

Reference Links

| Resource | Link | |----------|------| | API Reference | https://docs.rs/azure_messaging_eventhubs | | Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/eventhubs/azure_messaging_eventhubs | | crates.io | https://crates.io/crates/azure_messaging_eventhubs |

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/azure-event-hubs-rust-sdk-msr1u8mq/download' --output '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md.part' && mv '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md.part' '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Installation
cargo add azure_messaging_eventhubs azure_identity

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md' && test -s '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/azure-eventhub-rust' && cp -R '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq' '.claude/skills/azure-eventhub-rust'

Cursor
test -f '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md' && test -s '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/azure-eventhub-rust' && cp -R '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq' '.cursor/skills/azure-eventhub-rust'

Codex
test -f '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md' && test -s '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/azure-eventhub-rust' && cp -R '.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq' '.agents/skills/azure-eventhub-rust'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq'

openskills read 'azure-event-hubs-rust-sdk-msr1u8mq'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/azure-event-hubs-rust-sdk-msr1u8mq/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills