Microsoft.Orleans.Streaming.EventHubs
9.2.0-preview3
Prefix Reserved
dotnet add package Microsoft.Orleans.Streaming.EventHubs --version 9.2.0-preview3
NuGet\Install-Package Microsoft.Orleans.Streaming.EventHubs -Version 9.2.0-preview3
<PackageReference Include="Microsoft.Orleans.Streaming.EventHubs" Version="9.2.0-preview3" />
<PackageVersion Include="Microsoft.Orleans.Streaming.EventHubs" Version="9.2.0-preview3" />
<PackageReference Include="Microsoft.Orleans.Streaming.EventHubs" />
paket add Microsoft.Orleans.Streaming.EventHubs --version 9.2.0-preview3
#r "nuget: Microsoft.Orleans.Streaming.EventHubs, 9.2.0-preview3"
#addin nuget:?package=Microsoft.Orleans.Streaming.EventHubs&version=9.2.0-preview3&prerelease
#tool nuget:?package=Microsoft.Orleans.Streaming.EventHubs&version=9.2.0-preview3&prerelease
Microsoft Orleans Stream Provider for Azure Event Hubs
Introduction
Microsoft Orleans Stream Provider for Azure Event Hubs enables Orleans applications to leverage Azure Event Hubs for reliable, scalable event processing. This provider allows you to use Event Hubs as a streaming backbone for your Orleans application to both produce and consume streams of events.
Getting Started
To use this package, install it via NuGet:
dotnet add package Microsoft.Orleans.Streaming.EventHubs
Example - Configuring Event Hubs Stream Provider
using Microsoft.Extensions.Hosting;
using Orleans.Configuration;
using Orleans.Hosting;
namespace ExampleGrains;
var builder = Host.CreateApplicationBuilder(args)
.UseOrleans(siloBuilder =>
{
siloBuilder
.UseLocalhostClustering()
// Configure Azure Event Hubs as a stream provider
.AddEventHubStreams(
"EventHubStreamProvider",
configurator =>
{
configurator.ConfigureEventHub(builder => builder.Configure(options =>
{
options.ConnectionString = "YOUR_EVENT_HUB_CONNECTION_STRING";
options.ConsumerGroup = "YOUR_CONSUMER_GROUP"; // Default is "$Default"
options.Path = "YOUR_EVENT_HUB_NAME";
}));
configurator.UseAzureTableCheckpointer(builder => builder.Configure(options =>
{
options.ConnectionString = "YOUR_STORAGE_CONNECTION_STRING";
options.TableName = "EventHubCheckpoints"; // Optional
}));
});
});
// Run the host
await builder.RunAsync();
Example - Using Event Hub Streams in a Grain
// Grain interface
public interface IStreamProcessingGrain : IGrainWithGuidKey
{
Task StartProcessing();
}
// Grain implementation
public class StreamProcessingGrain : Grain, IStreamProcessingGrain
{
private IStreamProvider _streamProvider;
private IAsyncStream<MyEvent> _stream;
private StreamSubscriptionHandle<MyEvent> _subscription;
public override async Task OnActivateAsync(CancellationToken cancellationToken)
{
// Get the stream provider
_streamProvider = GetStreamProvider("EventHubStreamProvider");
// Get a reference to a specific stream
_stream = _streamProvider.GetStream<MyEvent>(this.GetPrimaryKey(), "MyStreamNamespace");
await base.OnActivateAsync(cancellationToken);
}
public async Task StartProcessing()
{
// Subscribe to the stream to process events
_subscription = await _stream.SubscribeAsync(OnNextAsync);
}
private Task OnNextAsync(MyEvent evt, StreamSequenceToken token)
{
Console.WriteLine($"Received event: {evt.Data}");
return Task.CompletedTask;
}
// Produce an event to the stream
public Task SendEvent(MyEvent evt)
{
return _stream.OnNextAsync(evt);
}
}
// Event class
public class MyEvent
{
public string Data { get; set; }
}
Documentation
For more comprehensive documentation, please refer to:
Feedback & Contributing
- If you have any issues or would like to provide feedback, please open an issue on GitHub
- Join our community on Discord
- Follow the @msftorleans Twitter account for Orleans announcements
- Contributions are welcome! Please review our contribution guidelines
- This project is licensed under the MIT license
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Azure.Core (>= 1.44.1)
- Azure.Data.Tables (>= 12.9.1)
- Azure.Messaging.EventHubs (>= 5.11.5)
- Microsoft.AspNetCore.Connections.Abstractions (>= 8.0.11)
- Microsoft.CodeAnalysis.Analyzers (>= 3.11.0)
- Microsoft.CodeAnalysis.Common (>= 4.5.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.5.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Configuration.Json (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.DependencyModel (>= 8.0.2)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Logging.Console (>= 8.0.1)
- Microsoft.Extensions.Logging.Debug (>= 8.0.1)
- Microsoft.Extensions.ObjectPool (>= 8.0.11)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Orleans.Analyzers (>= 9.2.0-preview3)
- Microsoft.Orleans.CodeGenerator (>= 9.2.0-preview3)
- Microsoft.Orleans.Streaming (>= 9.2.0-preview3)
- Newtonsoft.Json (>= 13.0.3)
- System.Collections.Immutable (>= 8.0.0)
- System.IO.Hashing (>= 8.0.0)
- System.IO.Pipelines (>= 8.0.0)
- System.Memory.Data (>= 8.0.1)
- System.Net.NameResolution (>= 4.3.0)
- System.Text.Json (>= 8.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Microsoft.Orleans.Streaming.EventHubs:
Package | Downloads |
---|---|
Microsoft.AutoGen.RuntimeGateway.Grpc
A programming framework for agentic AI |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Microsoft.Orleans.Streaming.EventHubs:
Repository | Stars |
---|---|
microsoft/project-oagents
Experimental AI Agents Framework
|
Version | Downloads | Last Updated |
---|---|---|
9.2.0-preview3 | 278 | 6/10/2025 |
9.2.0-preview2 | 133 | 6/4/2025 |
9.2.0-preview1 | 3,165 | 4/4/2025 |
9.1.2 | 32,100 | 2/13/2025 |
9.0.1 | 36,542 | 11/23/2024 |
9.0.0 | 1,068 | 11/14/2024 |
8.2.0 | 62,901 | 7/12/2024 |
8.2.0-preview1 | 139 | 5/22/2024 |
8.1.0 | 23,080 | 4/17/2024 |
8.1.0-preview3 | 1,050 | 3/11/2024 |
8.1.0-preview2 | 114 | 2/23/2024 |
8.1.0-preview1 | 1,209 | 2/13/2024 |
8.0.0 | 11,425 | 1/5/2024 |
8.0.0-rc2 | 173 | 12/20/2023 |
8.0.0-rc1 | 169 | 12/4/2023 |
7.2.7 | 263 | 10/15/2024 |
7.2.6 | 924 | 3/9/2024 |
7.2.5 | 301 | 2/22/2024 |
7.2.4 | 9,547 | 12/2/2023 |
7.2.3 | 4,104 | 11/3/2023 |
7.2.2 | 815 | 10/16/2023 |
7.2.1 | 6,112 | 7/11/2023 |
7.2.0 | 2,785 | 7/7/2023 |
7.1.2 | 3,800 | 4/19/2023 |
7.1.1 | 4,229 | 3/23/2023 |
7.1.0 | 5,487 | 2/1/2023 |
7.0.0 | 10,511 | 11/8/2022 |
7.0.0-rc2 | 458 | 10/19/2022 |
4.0.0-preview2 | 654 | 8/4/2022 |
4.0.0-preview1 | 445 | 2/10/2022 |