Goa.Functions.Sqs 0.0.3-preview.1

This is a prerelease version of Goa.Functions.Sqs.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Goa.Functions.Sqs --version 0.0.3-preview.1
                    
NuGet\Install-Package Goa.Functions.Sqs -Version 0.0.3-preview.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="Goa.Functions.Sqs" Version="0.0.3-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Goa.Functions.Sqs" Version="0.0.3-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Goa.Functions.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 Goa.Functions.Sqs --version 0.0.3-preview.1
                    
#r "nuget: Goa.Functions.Sqs, 0.0.3-preview.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 Goa.Functions.Sqs@0.0.3-preview.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=Goa.Functions.Sqs&version=0.0.3-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Goa.Functions.Sqs&version=0.0.3-preview.1&prerelease
                    
Install as a Cake Tool

Goa.Functions.Sqs

Process Amazon SQS messages in AWS Lambda with high performance and native AOT support. This package provides robust message processing capabilities with flexible batch or single-message handling, automatic error tracking for partial batch failures, and seamless integration with SQS features like message attributes, dead-letter queues, and visibility timeouts for reliable distributed messaging workflows.

Quick Start

dotnet new install Goa.Templates
dotnet new goa.sqs -n "MySqsFunction"

Features

  • Flexible Processing Modes: Process messages individually or as a batch for optimal throughput
  • Partial Batch Failures: Mark individual messages as failed for proper retry handling
  • Message Attributes: Access both system and user-defined message attributes
  • Native AOT Ready: Optimized for ahead-of-time compilation with minimal cold starts
  • Error Handling: Built-in support for dead-letter queue integration
  • Dependency Injection: Full integration with .NET's dependency injection container
  • JSON Deserialization: Type-safe message body deserialization with source generation

Basic Usage

using Goa.Functions.Core;
using Goa.Functions.Sqs;
using Microsoft.Extensions.Hosting;
using System.Text.Json;
using System.Text.Json.Serialization;

await Host.CreateDefaultBuilder()
    .UseLambdaLifecycle()
    .ForSQS()
    .ProcessOneAtATime()
    .HandleWith<IOrderProcessor>(async (processor, message) =>
    {
        // Deserialize the message body
        var order = JsonSerializer.Deserialize(message.Body!, AppJsonContext.Default.OrderMessage);
        
        // Process the order
        await processor.ProcessOrder(order!);
        
        // Access message attributes if needed
        var priority = message.MessageAttributes?["Priority"]?.StringValue;
        if (priority == "High")
        {
            await processor.HandleHighPriorityOrder(order!);
        }
    })
    .RunAsync();

// Define your message types
public record OrderMessage(string OrderId, string CustomerId, decimal Total, List<OrderItem> Items);
public record OrderItem(string ProductId, int Quantity, decimal Price);

public interface IOrderProcessor
{
    Task ProcessOrder(OrderMessage order);
    Task HandleHighPriorityOrder(OrderMessage order);
}

// JSON source generation for AOT compatibility
[JsonSourceGenerationOptions(WriteIndented = false)]
[JsonSerializable(typeof(OrderMessage))]
[JsonSerializable(typeof(OrderItem))]
public partial class AppJsonContext : JsonSerializerContext;

Documentation

For more information and examples, visit the main Goa documentation.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.3-preview.2 43 9/28/2025
0.0.3-preview.1 52 8/23/2025
0.0.2-preview.2.3 116 8/18/2025
0.0.2-preview.2.2 121 8/17/2025
0.0.2-preview.2.1 92 8/17/2025
0.0.2-preview.2 112 8/9/2025
0.0.0-alpha.0.32 76 12/7/2024
0.0.0-alpha.0.20 72 10/27/2024