Orleans stream providers
A stream provider connects the Orleans streaming API to a transport and defines its runtime semantics. Select a provider from required durability, replay, throughput, hosting environment, and operational ownership. Provider behavior still depends on backing-service configuration such as retention, replication, and visibility timeouts.
Provider matrix
Section titled “Provider matrix”| Provider | Package | Status | External event durability | Rewindable | External prerequisites |
|---|---|---|---|---|---|
| Memory | Microsoft.Orleans.Streaming | Stable | No; silo memory only | Yes, within the transient in-memory cache | None |
| Azure Queue Storage | Microsoft.Orleans.Streaming.AzureStorage | Stable | Yes, in Azure Storage queues | No | Azure Storage account or Azurite; credentials and a stable Orleans service ID |
| Azure Event Hubs | Microsoft.Orleans.Streaming.EventHubs | Stable | Yes, within Event Hubs retention | Yes | Event Hubs namespace, hub, consumer group, and checkpoint storage |
| Amazon Kinesis | Microsoft.Orleans.Streaming.Kinesis | Stable | Yes, within Kinesis retention | Yes | Kinesis data stream, AWS credentials, region, and durable checkpoint storage |
| Amazon SQS | Microsoft.Orleans.Streaming.SQS | Stable | Yes, within SQS retention | No | AWS account, queue permissions, region/endpoint configuration |
| ADO.NET | Microsoft.Orleans.Streaming.AdoNet | Alpha | Yes, in relational tables until expiry/dead-letter eviction | No | Supported database, ADO.NET driver, and Orleans streaming SQL schema |
| NATS JetStream | Microsoft.Orleans.Streaming.NATS | Alpha | Configurable; file storage is the default | No | NATS server with JetStream and sufficient storage; subject/stream administration |
| Redis Streams | Microsoft.Orleans.Streaming.Redis | Alpha | Configurable through Redis persistence and stream retention | Yes, while entries remain | Redis deployment, persistence/HA policy, and retention sizing |
Alpha packages have an alpha.1 version suffix. Treat their APIs and operational behavior as prerelease, validate failure modes under load, and pin versions deliberately.
Kafka and Azure Service Bus aren’t built-in Orleans stream providers. Integrate them through application code or a custom persistent-stream queue adapter rather than configuring a nonexistent built-in provider.
Memory streams
Section titled “Memory streams”Register memory streams with AddMemoryStreams. They use silo memory for queues and cache, so events don’t survive cluster loss. Rewind works only while the relevant event remains in the live in-memory cache. Use this provider for local development, tests, and workloads where loss is explicitly acceptable.
Azure Queue Storage
Section titled “Azure Queue Storage”Register Azure Queue streams with AddAzureQueueStreams. The provider uses multiple Azure Queue Storage queues and persistent-stream pulling agents. It isn’t rewindable, and Azure Queue retries can produce duplicates or reorder delivery after failures.
Configure the current QueueServiceClient directly on AzureQueueOptions. When QueueNames is unset, Orleans generates names from the Orleans service ID, provider name, and queue ID. Keep the service ID and provider name stable across restarts. Set queue names explicitly only when you need to manage an existing queue topology, and keep those names unique across clusters that share a storage account.
Managed identity
Section titled “Managed identity”var queueEndpoint = new Uri(configuration["AZURE_QUEUE_STORAGE_ENDPOINT"]!);var credential = new DefaultAzureCredential();
hostBuilder.UseOrleans(siloBuilder =>{ siloBuilder .AddAzureQueueStreams( TemperatureStreams.ProviderName, streams => streams.ConfigureAzureQueue( optionsBuilder => optionsBuilder.Configure(options => options.QueueServiceClient = new QueueServiceClient(queueEndpoint, credential)))) .AddAzureTableGrainStorage( "PubSubStore", options => options.TableServiceClient = new TableServiceClient( new Uri(configuration["AZURE_TABLE_STORAGE_ENDPOINT"]!), credential));});Connection string
Section titled “Connection string”hostBuilder.UseOrleans(siloBuilder =>{ siloBuilder .AddAzureQueueStreams( TemperatureStreams.ProviderName, streams => streams.ConfigureAzureQueue( optionsBuilder => optionsBuilder.Configure(options => options.QueueServiceClient = new QueueServiceClient(connectionString)))) .AddAzureTableGrainStorage( "PubSubStore", options => options.TableServiceClient = new TableServiceClient(connectionString));});The examples use durable Azure Table Storage for PubSubStore; queue durability alone doesn’t preserve explicit subscription records.
Azure Event Hubs
Section titled “Azure Event Hubs”Register Azure Event Hubs with AddEventHubStreams. Event Hubs retention and partition positions make this provider rewindable. Configure a consumer group dedicated to the Orleans application and durable checkpoint storage. Partition count bounds physical read parallelism, and retention bounds how far recovery can rewind.
The Event Hubs provider supports a custom data adapter for provider-specific wire formats. See Integrate external stream producers and consumers when a non-Orleans application must publish to or consume from the same Event Hub.
Amazon Kinesis
Section titled “Amazon Kinesis”Register Amazon Kinesis Data Streams with AddKinesisStreams. Kinesis retains events independently of Orleans, and the provider persists each shard’s last delivered sequence number so that delivery can resume after shutdown or queue reassignment. See Stream with Amazon Kinesis for configuration, checkpoint choices, and operational constraints.
Amazon SQS
Section titled “Amazon SQS”Register Amazon SQS with AddSqsStreams. Standard queues use at-least-once delivery, and SQS redelivers after the visibility timeout when processing isn’t acknowledged. The Orleans provider isn’t rewindable. Configure credentials using the deployment environment’s AWS credential chain or protected connection configuration, and monitor queue age, redelivery, and dead-letter policy.
ADO.NET streaming (alpha)
Section titled “ADO.NET streaming (alpha)”Register ADO.NET streaming with AddAdoNetStreams. Install the matching database driver and apply the SQL Server, PostgreSQL, or MySQL streaming schema shipped in the package source. Messages are durable in relational tables but expire and can move to dead letters according to AdoNetStreamOptions. The provider isn’t rewindable.
NATS JetStream streaming (alpha)
Section titled “NATS JetStream streaming (alpha)”Register NATS JetStream with AddNatsStreams. The provider creates or uses a JetStream stream and deterministic subject partitions. File-backed storage is the default; memory-backed JetStream storage is optional and not durable across server loss. Changes to NatsOptions.PartitionCount require corresponding server-side stream updates. The provider isn’t rewindable.
Redis Streams streaming (alpha)
Section titled “Redis Streams streaming (alpha)”Register Redis Streams with AddRedisStreams. The provider stores events and checkpoints in Redis and is rewindable while entries remain. Redis durability depends on its persistence and replication configuration. RedisStreamingOptions.MaxStreamLength can bound retention; without it, stream length is unbounded, so capacity planning is required.
Custom adapters
Section titled “Custom adapters”A persistent-stream data adapter customizes the wire format used by Azure Queue Storage or Azure Event Hubs while retaining that provider’s transport, partitioning, acknowledgement, cache, and recovery behavior.
PersistentStreamProvider hosts providers built on IQueueAdapter. A custom queue adapter supplies enqueue/dequeue behavior, queue mapping, rewindability, and failure handling while Orleans supplies pulling agents, subscription routing, and caches. See Write a custom persistent-stream queue adapter for an implementation guide and stream implementation architecture for the runtime design.
