Lycia 1.17.0-beta-0008-gdc707c4f4f

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

Lycia

NuGet NuGet Downloads Target Framework Build License GitHub release

Lycia is the main package of the Lycia framework.
It provides the saga infrastructure, orchestration, and choreography support.
Extensions (e.g. Redis, RabbitMQ, Scheduling) are published separately under Lycia.Extensions.*.

Lycia began with a vision on May 28, 2023.
Our motto: “Turning difficult paths into joyful simplicity.” Inspired by the ancient Lycian Way, we set out to build a framework that makes complex saga workflows easy to manage — supported by strong documentation and aligned with modern software practices.

Lycia is a messaging framework (Message-oriented Middleware, MoM) built for .NET applications, supporting .NET Standard 2.0 and higher. It provides a robust foundation for distributed systems where reliable message flow and state coordination are essential.

For architectural deep-dive, compensation coordination, and integration test strategies, see DEVELOPERS.md.


Getting Started / Samples

Explore the samples/ folder for real-world usage:

  • Sample.Order.Api – API entrypoint
  • Sample.Order.Orchestration.Consumer – Coordinated saga orchestration
  • Sample.Order.Choreography.Consumer – Reactive saga choreography
  • Sample.Order.Orchestration.Seq.Consumer – Sequential orchestration with compensation flows

Our Mission

  • Simplicity: Define complex orchestration flows with ease.
  • Flexibility: Support both orchestration (which we call Coordinated Saga) and choreography (our term: Reactive Saga) patterns.
  • Portability: Work out of the box with popular infrastructures like RabbitMQ and Redis.
  • Robust Documentation: Step-by-step guides, code samples, and best practices to lead the way.

What Makes Lycia Different

Unlike other frameworks, Lycia offers:

  • Minimal Setup – Start with a single line:
services.AddLycia(Configuration)
        .AddSagasFromCurrentAssembly()
        .Build();
  • Clear Naming and Semantics:

    • Coordinated Saga → central orchestrator-based saga management
    • Reactive Saga → event-driven choreography approach
  • Built-in support for idempotency, timeouts, and in-process retries with Polly, Ack/Nack + DLQ support on RabbitMQ

  • Default Middleware Pipeline (Logging + Retry, replaceable via UseSagaMiddleware)

  • Extensibility: Easily plug in custom implementations of IMessageSerializer, IEventBus, or ISagaStore.


Quick Start

Coordinated Saga (Orchestration)

public class CreateOrderSagaHandler :
    StartCoordinatedResponsiveSagaHandler<CreateOrderCommand, OrderCreatedResponse, CreateOrderSagaData>
{
    public override async Task HandleAsync(CreateOrderCommand cmd, CancellationToken ct = default)
    {
        // Business logic
        await Context.Publish(new OrderCreatedResponse { OrderId = cmd.OrderId }, ct);
        await Context.MarkAsComplete<CreateOrderCommand>(ct);
    }
}

Reactive Saga (Choreography)

public class InventorySagaHandler :
    ReactiveSagaHandler<OrderCreatedEvent>,
    ISagaCompensationHandler<PaymentFailedEvent>
{
    public override async Task HandleAsync(OrderCreatedEvent evt, CancellationToken ct = default)
    {
        // Reserve inventory
        await Context.Publish(new InventoryReservedEvent { OrderId = evt.OrderId }, ct);
        await Context.MarkAsComplete<OrderCreatedEvent>(ct);
    }

    public Task CompensateAsync(PaymentFailedEvent failed, CancellationToken ct = default)
    {
        // Release reserved stock
        InventoryService.ReleaseStock(failed.OrderId);
        return Task.CompletedTask;
    }
}

Timeline

  • May 28, 2023 – The idea was born.
  • Initial Goal – To provide a saga framework that avoids complexity and is easy to use by anyone.
  • Today – Development accelerated by "vibe-coding"; includes tests, integrations, and real-world usage scenarios.

What's Next

  • Kafka support
  • Schema registry (Avro/Protobuf) integration
  • Advanced observability (metrics, tracing, logging)
  • Native support for Outbox/Inbox pattern
  • Advanced retry customization, scheduling module

License

This project is licensed under the Apache 2.0 License.

Why Lycia? (Deep Dive Highlights)

In addition to minimal setup and clear semantics, Lycia offers:

  • SagaDispatcher and CompensationCoordinator core components
  • Built-in Idempotency and cancellation flow (MarkAsCancelled<T>())
  • Custom Retry Hooks finalized via IRetryPolicy (with Polly-based default implementation, configurable via ConfigureRetry), supporting exponential backoff, jitter, and per-exception retry strategies
  • Choreography & Orchestration support via ReactiveSagaHandler<T> and StartCoordinatedSagaHandler<T>
  • RedisSagaStore built-in extension support with TTL, CAS, parent-child message tracing
  • RabbitMQ EventBus built-in extension support with Dead Letter Queue (DLQ) and header normalization
  • ISagaContextAccessor for contextual saga state access
  • Fluent Middleware Pipeline: Default logging and retry middleware, replaceable via middleware slots (ILoggingSagaMiddleware, IRetrySagaMiddleware)
  • Fluent Configuration API: Easily plug your custom serializers, stores and buses
  • Detailed Integration Tests for Redis, RabbitMQ (including Ack/Nack/DLQ behavior), Compensation logic
  • Appsettings.json Support: Environment-based saga configuration
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 Lycia:

Package Downloads
Lycia.Extensions

Lycia.Extensions provides pluggable modules and integrations for the Lycia Saga framework. It offers ready-to-use extensions for configuration, middleware, retry, scheduling, and observability: - Fluent DI registration (AddLycia with ConfigureSaga, ConfigureEventBus, ConfigureRetry, ConfigureScheduling) - Built-in retry policies with Polly integration - Configurable middleware slots (logging, retry, custom middlewares) - Health check integration (IHealthCheck) - Scheduling extensions with Redis-based storage Keep your Saga setup modular, extensible, and production-grade. Add only the components you need.

GitHub repositories

This package is not used by any popular GitHub repositories.