我正在探索使用 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/