Azure.Messaging.EventHubs (.NET)
Build Event Streaming with Azure Event Hubs
This skill helps developers integrate Azure Event Hubs into .NET applications for real-time event streaming, enabling scalable pub-sub messaging and event-driven architectures.
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“Azure.Messaging.EventHubs (.NET)”。 Show me how to create an Event Hubs producer in .NET
预期结果:
To create an Event Hubs producer in .NET, use the EventHubProducerClient from the Azure.Messaging.EventHubs package. First, install the NuGet package, then create a producer instance with your connection string and hub name. The producer can send single events or batches of events. Remember to dispose of the producer when done or use 'using' statements for automatic cleanup.
正在使用“Azure.Messaging.EventHubs (.NET)”。 Explain partitions and consumer groups in Event Hubs
预期结果:
Partitions are the basic unit of parallelism in Event Hubs. Each partition holds a sequence of events and can be processed independently. Consumer groups are logical subscribers that maintain their own position in the stream. Multiple consumer groups enable different consumers to read the same events independently. For ordered processing, all related events should go to the same partition using a partition key.
安全审计
安全This is a prompt-only skill with no executable code. The static analyzer scanned 0 files (0 lines) and detected no security issues. The skill provides guidance on Azure Event Hubs .NET SDK usage through prompts and documentation. No dangerous patterns, network requests, filesystem access, environment variable usage, or external command execution were detected.
质量评分
你能构建什么
Build event-driven microservices
Create loosely coupled microservices that communicate through event streaming for scalable distributed systems
Implement real-time data pipelines
Process streaming data from IoT devices, click streams, or log aggregation in real-time
Modernize legacy messaging systems
Migrate from traditional message queues to event streaming with Event Hubs integration
试试这些提示
Show me how to create an Event Hubs producer in .NET to send messages to a specific hub.
Create an Event Hubs consumer that processes events and saves checkpoints for reliable processing.
Generate code to publish events in batches for better throughput and performance.
Explain how to implement a partition routing strategy for ordered event processing.
最佳实践
- Use partition keys for related events to maintain ordering within a partition
- Implement checkpointing in consumers to enable resume after failures
- Use batch publishing for high-throughput scenarios to reduce network overhead
避免
- Do not create a new producer for each message - reuse producer instances
- Avoid processing events synchronously in the receive callback - use async processing
- Do not ignore the PartitionContext when implementing checkpointing for reliable processing