azure - 如何从azure事件中心获取数据?

标签 azure azure-eventhub

我正在探索使用 azure 事件中心作为事件使用者。

因此,我的 .NET 应用程序将事件发送到 azure 事件中心。事件中心默认有 4 个分区。

我希望将事件存储在 azure blob 存储中,并传递给另一个 .NET 应用程序。

这个问题是问 - azure 事件中心是否有能力将事件推送到 blob 和我的 .NET 应用程序,或者订阅者(blob 和 .NET 应用程序)是否需要从 azure 中提取数据事件中心分区?

或者我的 .NET 订阅者需要从 azure blob 中提取事件吗?

最佳答案

您需要使用.Net 创建接收器,

这是 docs 上的示例.

// Read from the default consumer group: $Default
string consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName;

// Create a blob container client that the event processor will use 
storageClient = new BlobContainerClient(blobStorageConnectionString, blobContainerName);

// Create an event processor client to process events in the event hub
processor = new EventProcessorClient(storageClient, consumerGroup, ehubNamespaceConnectionString, eventHubName);

// Register handlers for processing events and handling errors
processor.ProcessEventAsync += ProcessEventHandler;
processor.ProcessErrorAsync += ProcessErrorHandler;

// Start the processing
await processor.StartProcessingAsync();

关于azure - 如何从azure事件中心获取数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74312690/

相关文章:

azure - "az ad app permission list-grants"与 Azure 门户中为应用程序列出的内容不匹配

azure - 来自事件中心的数据未填充到 ADX 数据库中

azure - 在Azure databricks中,将pyspark数据帧写入eventhub花费的时间太长,因为数据帧中有300万条记录

c# - 如何针对 Azure 事件处理器主机编写端到端测试

azure - 监视特定事件日志以触发 Azure Function

python - 导入错误: cannot import name 'BlobService' when using Azure Backend

azure - AZURE AD 中的 API 权限(7 月 19 日版本)

azure - 与 ADF 同步增量数据

C# Azure EventHub 连接异常

azure - 如何将存储在 azure 表或事件中心中的指标公开给 prometheus?