VOOZH about

URL: https://www.nuget.org/packages/Catga.Transport.Redis/

โ‡ฑ NuGet Gallery | Catga.Transport.Redis 0.1.1


๏ปฟ

Catga.Transport.Redis 0.1.1

dotnet add package Catga.Transport.Redis --version 0.1.1
 
 
NuGet\Install-Package Catga.Transport.Redis -Version 0.1.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="Catga.Transport.Redis" Version="0.1.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Catga.Transport.Redis" Version="0.1.1" />
 
Directory.Packages.props
<PackageReference Include="Catga.Transport.Redis" />
 
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 Catga.Transport.Redis --version 0.1.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Catga.Transport.Redis, 0.1.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 Catga.Transport.Redis@0.1.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=Catga.Transport.Redis&version=0.1.1
 
Install as a Cake Addin
#tool nuget:?package=Catga.Transport.Redis&version=0.1.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<div align="center">

<img src="docs/web/favicon.svg" width="120" height="120" alt="Catga Logo"/>

Catga

High-Performance .NET CQRS/Event Sourcing Framework

๐Ÿ‘ .NET 9
๐Ÿ‘ Native AOT

Zero Reflection ยท Source Generated ยท Native AOT ยท Distributed Ready

Quick Start ยท Performance ยท Examples ยท Documentation

</div>


โšก Performance

BenchmarkDotNet on AMD Ryzen 7 5800H, .NET 9.0.8

Scenario Latency Memory Throughput
Create Order (Command) 351 ns 104 B 2.8M ops/sec
Get Order (Query) 337 ns 80 B 2.9M ops/sec
Event (3 handlers) 352 ns 208 B 2.8M ops/sec
Complete Flow (Command + Event) 729 ns 312 B 1.4M ops/sec
E-Commerce (Order + Payment + Query) 923 ns 416 B 1.1M ops/sec
Batch 10 Flows 10.2 ฮผs 4.2 KB 98K flows/sec
Concurrent 10 Flows 9.3 ฮผs 4.3 KB 108K flows/sec
High-Throughput 20 Orders 5.8 ฮผs 5.4 KB 172K ops/sec

โœจ Features

  • Zero Reflection - Source Generator, compile-time handler discovery
  • Native AOT - Full support, trimming safe
  • Distributed - Redis Streams, NATS JetStream
  • Event Sourcing - Event Store, Snapshots, Projections, Time Travel
  • Flow DSL - Distributed workflows, Sagas, ForEach parallel processing
  • Reliability - Outbox/Inbox, Idempotency, Dead Letter Queue
  • Observability - OpenTelemetry tracing, Metrics

๐Ÿš€ Quick Start

dotnet add package Catga
dotnet add package Catga.Transport.InMemory
dotnet add package Catga.Persistence.InMemory
dotnet add package Catga.Serialization.MemoryPack
// Define command
[MemoryPackable]
public partial record CreateOrder(string ProductId, int Quantity) : IRequest<Order>;

// Define handler
public class CreateOrderHandler : IRequestHandler<CreateOrder, Order>
{
 public ValueTask<CatgaResult<Order>> HandleAsync(CreateOrder cmd, CancellationToken ct = default)
 => new(CatgaResult<Order>.Success(new Order(cmd.ProductId, cmd.Quantity)));
}

// Configure
builder.Services.AddCatga().UseMemoryPack();
builder.Services.AddInMemoryTransport();
builder.Services.AddInMemoryPersistence();

// Use
var result = await mediator.SendAsync<CreateOrder, Order>(new("PROD-001", 5));

๐Ÿ“ฆ Packages

Package Description
Catga Core framework
Catga.Transport.InMemory In-memory transport
Catga.Transport.Redis Redis Streams
Catga.Transport.Nats NATS JetStream
Catga.Persistence.InMemory In-memory persistence
Catga.Persistence.Redis Redis persistence
Catga.Persistence.Nats NATS persistence
Catga.Serialization.MemoryPack Binary serialization
Catga.AspNetCore ASP.NET Core integration

๐Ÿ›’ OrderSystem Example

A complete e-commerce system demonstrating best practices. Focus on your business logic, not framework boilerplate.

examples/OrderSystem/
โ”œโ”€โ”€ Commands/ # Command definitions
โ”œโ”€โ”€ Queries/ # Query definitions
โ”œโ”€โ”€ Events/ # Event definitions
โ”œโ”€โ”€ Handlers/ # Business logic
โ”œโ”€โ”€ Flows/ # Distributed workflows
โ”œโ”€โ”€ Models/ # Domain models
โ””โ”€โ”€ Program.cs # Minimal setup

Run

cd examples/OrderSystem
dotnet run

# Run tests
.\test.ps1

Key Patterns

1. Commands & Queries - Clean separation of write/read operations

// Command - changes state
public record CreateOrder(string CustomerId, List<OrderItem> Items) : IRequest<Order>;

// Query - reads state
public record GetOrder(string OrderId) : IRequest<Order>;

2. Event Sourcing - Full audit trail

public record OrderCreated(string OrderId, string CustomerId) : IEvent;
public record OrderShipped(string OrderId, string TrackingNumber) : IEvent;

3. Flow DSL - Distributed workflows

public class OrderFlow : FlowConfig<OrderState>
{
 protected override void Configure(IFlowBuilder<OrderState> flow)
 {
 flow.Send(s => new ReserveInventory(s.Items))
 .IfFail(s => new ReleaseInventory(s.ReservationId));
 
 flow.Send(s => new ProcessPayment(s.OrderId, s.Total))
 .IfFail(s => new RefundPayment(s.PaymentId));
 
 flow.Publish(s => new OrderCompleted(s.OrderId));
 }
}

๐Ÿ—„๏ธ Event Sourcing

// Append events
await eventStore.AppendAsync("Order-123", new[] { orderCreated, itemAdded });

// Read stream
var stream = await eventStore.ReadAsync("Order-123");

// Snapshots
await snapshotStore.SaveAsync("Order-123", aggregate, version);

// Time Travel
var stateAtV5 = await timeTravelService.GetStateAtVersionAsync("order-1", 5);

๐Ÿ”„ Flow DSL

public class ProcessOrderFlow : FlowConfig<OrderState>
{
 protected override void Configure(IFlowBuilder<OrderState> flow)
 {
 // Sequential steps with compensation
 flow.Send(s => new ReserveInventory(s.OrderId))
 .Into(s => s.ReservationId)
 .IfFail(s => new ReleaseInventory(s.ReservationId));

 // Parallel processing
 flow.ForEach<OrderItem>(s => s.Items)
 .Configure((item, f) => f.Send(s => new ProcessItem(item.Id)))
 .WithParallelism(4)
 .ContinueOnFailure()
 .EndForEach();

 // Conditional logic
 flow.If(s => s.AllItemsProcessed)
 .Send(s => new CompleteOrder(s.OrderId))
 .EndIf();
 }
}

๐Ÿ”ง Configuration

// OpenTelemetry
builder.Services.AddOpenTelemetry()
 .WithTracing(t => t.AddSource(CatgaOpenTelemetryExtensions.ActivitySourceName))
 .WithMetrics(m => m.AddMeter(CatgaOpenTelemetryExtensions.MeterName));

// Resilience
builder.Services.AddCatga()
 .UseResilience(o => o.TransportRetryCount = 3);

// Reliability
builder.Services.AddCatga()
 .UseInbox()
 .UseOutbox();

๐Ÿ“š Documentation


๐Ÿ“„ License

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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.1.1 137 1/17/2026
0.1.0 211 12/24/2025