Microsoft.Orleans.Streaming.SQS 9.2.1

Prefix Reserved
dotnet add package Microsoft.Orleans.Streaming.SQS --version 9.2.1
                    
NuGet\Install-Package Microsoft.Orleans.Streaming.SQS -Version 9.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Orleans.Streaming.SQS" Version="9.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Orleans.Streaming.SQS" Version="9.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Orleans.Streaming.SQS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Orleans.Streaming.SQS --version 9.2.1
                    
#r "nuget: Microsoft.Orleans.Streaming.SQS, 9.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Orleans.Streaming.SQS@9.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Orleans.Streaming.SQS&version=9.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Orleans.Streaming.SQS&version=9.2.1
                    
Install as a Cake Tool

Microsoft Orleans Streaming for Amazon SQS

Introduction

Microsoft Orleans Streaming for Amazon SQS provides a stream provider implementation for Orleans using Amazon Simple Queue Service (SQS). This allows for publishing and subscribing to streams of events with SQS as the underlying messaging infrastructure.

Getting Started

To use this package, install it via NuGet:

dotnet add package Microsoft.Orleans.Streaming.SQS

Example - Configuring SQS Streaming

using Microsoft.Extensions.Hosting;
using Orleans.Hosting;
using Orleans.Streams;

var builder = Host.CreateApplicationBuilder(args)
    .UseOrleans(siloBuilder =>
    {
        siloBuilder
            .UseLocalhostClustering()
            // Configure SQS as a stream provider
            .AddSqsStreams(
                name: "SQSStreamProvider",
                configureOptions: options =>
                {
                    options.AccessKey = "YOUR_AWS_ACCESS_KEY";
                    options.SecretKey = "YOUR_AWS_SECRET_KEY";
                    options.Region = "us-east-1";
                });
    });

// Run the host
await builder.RunAsync();

Example - Using SQS Streams in a Grain

using System;
using System.Threading;
using System.Threading.Tasks;
using Orleans;
using Orleans.Streams;

// Producer grain
public class ProducerGrain : Grain, IProducerGrain
{
    private IAsyncStream<string> _stream;

    public override Task OnActivateAsync(CancellationToken cancellationToken)
    {
        // Get a reference to a stream
        var streamProvider = GetStreamProvider("SQSStreamProvider");
        _stream = streamProvider.GetStream<string>(Guid.NewGuid(), "MyStreamNamespace");
        
        return base.OnActivateAsync(cancellationToken);
    }

    public async Task SendMessage(string message)
    {
        // Send a message to the stream
        await _stream.OnNextAsync(message);
    }
}

// Consumer grain
public class ConsumerGrain : Grain, IConsumerGrain, IAsyncObserver<string>
{
    private StreamSubscriptionHandle<string> _subscription;

    public override async Task OnActivateAsync(CancellationToken cancellationToken)
    {
        // Get a reference to a stream
        var streamProvider = GetStreamProvider("SQSStreamProvider");
        var stream = streamProvider.GetStream<string>(this.GetPrimaryKey(), "MyStreamNamespace");
        
        // Subscribe to the stream
        _subscription = await stream.SubscribeAsync(this);
        
        await base.OnActivateAsync(cancellationToken);
    }

    public Task OnNextAsync(string item, StreamSequenceToken token = null)
    {
        Console.WriteLine($"Received message: {item}");
        return Task.CompletedTask;
    }

    public Task OnCompletedAsync()
    {
        Console.WriteLine("Stream completed");
        return Task.CompletedTask;
    }

    public Task OnErrorAsync(Exception ex)
    {
        Console.WriteLine($"Stream error: {ex.Message}");
        return Task.CompletedTask;
    }
}

Documentation

For more comprehensive documentation, please refer to:

Feedback & Contributing

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Microsoft.Orleans.Streaming.SQS:

Package Downloads
Microsoft.Orleans.OrleansAWSUtils

Library of utility types for Amazon AWS of Microsoft Orleans.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.2.1 1,894 7/16/2025
9.2.0 493 7/14/2025
9.2.0-preview3 302 6/10/2025
9.2.0-preview2 158 6/4/2025
9.2.0-preview1 129 4/4/2025
9.1.2 35,310 2/13/2025
9.0.1 26,978 11/23/2024
9.0.0 824 11/14/2024
8.2.0 8,746 7/12/2024
8.2.0-preview1 200 5/22/2024
8.1.0 39,041 4/17/2024
8.1.0-preview3 168 3/11/2024
8.1.0-preview2 167 2/23/2024
8.1.0-preview1 164 2/13/2024
8.0.0 18,951 1/5/2024
8.0.0-rc2 188 12/20/2023
8.0.0-rc1 208 12/4/2023
7.2.7 211 10/15/2024
7.2.6 6,132 3/9/2024
7.2.5 223 2/22/2024
7.2.4 3,997 12/2/2023
7.2.3 4,006 11/3/2023
7.2.2 2,971 10/16/2023
7.2.1 4,961 7/11/2023
7.2.0 500 7/7/2023
7.1.2 3,415 4/19/2023
7.1.1 6,556 3/23/2023
7.1.0 1,529 2/1/2023
7.0.0 3,470 11/8/2022
7.0.0-rc2 264 10/19/2022
4.0.0-preview2 291 8/4/2022
4.0.0-preview1 508 2/10/2022
3.8.0 199 5/6/2025
3.8.0-preview5 242 5/12/2025
3.8.0-preview3 193 4/8/2025
3.8.0-preview2 128 4/4/2025
3.8.0-preview1 201 3/31/2025
3.7.2 3,573 5/10/2024
3.7.1 1,206 5/27/2023
3.7.0 458 3/23/2023
3.6.5 15,131 8/15/2022
3.6.4 544 8/10/2022
3.6.3 547 8/4/2022
3.6.2 1,195 4/15/2022
3.6.1 592 4/5/2022
3.6.0 1,249 1/20/2022
3.5.1 1,067 11/8/2021
3.5.0 5,642 9/3/2021
3.4.4 530 10/4/2021
3.4.3 1,259 6/3/2021
3.4.2 673 4/5/2021
3.4.1 1,777 2/3/2021
3.4.0 1,602 1/6/2021
3.4.0-rc1 460 12/9/2020
3.3.0 15,678 9/9/2020
3.3.0-rc2 526 9/2/2020
3.3.0-rc1 574 8/19/2020
3.2.2 945 7/22/2020
3.2.1 946 7/2/2020
3.2.0 1,391 6/4/2020
3.2.0-rc2 663 5/20/2020
3.2.0-rc1 601 5/7/2020
3.1.7 2,058 5/19/2020
3.1.6 1,000 4/16/2020
3.1.5 926 4/9/2020
3.1.4 875 3/26/2020
3.1.3 886 3/16/2020
3.1.2 1,708 3/5/2020
3.1.0 969 2/23/2020
3.1.0-rc3 623 2/13/2020
3.1.0-rc2 681 2/12/2020
3.1.0-rc1 698 2/10/2020
3.0.2 971 12/12/2019
3.0.1 1,077 11/27/2019
3.0.0 932 10/24/2019
3.0.0-rc2 627 10/16/2019
3.0.0-rc1 616 10/9/2019
3.0.0-beta1 1,123 8/16/2019
2.4.5 13,284 12/29/2019
2.4.4 1,275 11/27/2019
2.4.3 1,512 10/10/2019
2.4.2 2,482 8/31/2019
2.4.1 1,309 8/14/2019
2.4.0 1,355 8/8/2019
2.3.6 1,614 7/24/2019
2.3.5 5,260 6/14/2019
2.3.4 1,661 6/4/2019
2.3.3 1,345 6/2/2019
2.3.2 1,576 5/9/2019
2.3.1 1,361 4/26/2019
2.3.0 3,122 3/20/2019
2.3.0-rc2 797 3/13/2019
2.3.0-rc1 894 3/4/2019
2.2.4 2,452 2/25/2019
2.2.3 2,643 1/17/2019
2.2.0 1,521 12/13/2018
2.2.0-rc1 949 12/4/2018
2.2.0-beta1 1,036 10/21/2018
2.1.2 3,522 10/11/2018
2.1.0 1,772 9/28/2018
2.1.0-rc2 1,266 9/21/2018
2.1.0-rc1 1,355 9/14/2018
2.1.0-beta1 1,322 8/27/2018
2.0.0 8,732 3/28/2018
2.0.0-rc2 5,153 3/13/2018
2.0.0-rc1 1,493 2/26/2018
2.0.0-beta3 3,112 12/21/2017