SmartPipe.Core 1.0.3

Suggested Alternatives

SmartPipe.Core 1.0.5

Additional Details

Critical bugs fixed in v1.0.5. Thread-safety, evasion detection, P-controller fixes.

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

SmartPipe.Core

Universal streaming pipeline engine for .NET 10 with zero dependencies.

Built on System.Threading.Channels, SmartPipe.Core provides a production-ready pipeline engine for ETL, real-time stream processing, API aggregation, and AI agent integration β€” all with 0 allocations in hot path.

CI NuGet Core NuGet Extensions License: MIT Coverage

πŸ“– Complete Feature Reference β†’

What is SmartPipe?

SmartPipe is not just another ETL library. It's a universal streaming pipeline engine that handles:

  • ETL/ELT β€” extract from DB/API, transform, load to anywhere
  • Real-time stream processing β€” process events as they arrive
  • API aggregation β€” fan-out requests, aggregate responses
  • Data validation pipelines β€” validate, enrich, route
  • AI agent tools β€” integrate with Semantic Kernel, AutoGen
  • Log/sensor processing β€” process IoT telemetry, application logs
  • Error recovery & dead letter β€” capture failures for later replay
  • Stream merging β€” combine multiple data sources into one pipeline

All in 5 lines of code:

using SmartPipe.Core;
using SmartPipe.Extensions;

var pipeline = PipelineBuilder
    .From(new HttpSelector<MyDto>("https://api.example.com/data"))
    .Transform(x => x.Enrich())       // Middleware for simple ops
    .Transform(new JsonTransform<MyDto, MyEntity>())  // ITransformer for complex
    .WithOptions(o => o.MaxDegreeOfParallelism = 4);
await pipeline.To(new LoggerSink<MyEntity>(logger));

Examples by Scenario

Middleware Pattern (5 lines)

var pipeline = PipelineBuilder
    .From(new HttpSelector<int>("https://api.example.com/numbers"))
    .Transform(x => x * 2)          // Middleware!
    .Transform(x => x + 1)          // Middleware!
    .WithOptions(o => o.MaxDegreeOfParallelism = 4);
await pipeline.To(new LoggerSink<int>(logger));

ETL Pipeline (Database β†’ Transform β†’ API)

var pipeline = PipelineBuilder
    .From(new EfCoreSelector<Order>(dbContext).WithQuery(q => q.Where(o => o.Status == "Pending")))
    .Transform(new MapsterTransform<Order, OrderDto>())
    .Transform(new PollyResilienceTransform<OrderDto>(resiliencePipeline))
    .WithOptions(o => o.MaxDegreeOfParallelism = 8);
await pipeline.To(new HttpSink<OrderDto>(httpClient, "https://api.destination.com/orders"));

Real-time Stream Processing (API β†’ Filter β†’ Log)

var pipeline = PipelineBuilder
    .From(new HttpSelector<SensorData>("https://iot.example.com/telemetry"))
    .Transform(new JsonTransform<SensorData, SensorData>())
    .Transform(new MapsterTransform<SensorData, Alert>())
    .WithOptions(o => { o.MaxDegreeOfParallelism = 2; o.ContinueOnError = true; });
await pipeline.To(new LoggerSink<Alert>(logger));

AI Agent Tool (Semantic Kernel Integration)

var tool = new PipelineTool<string, string>("summarize", "Summarize text using AI");
tool.AddTransformer(new JsonTransform<string, PromptDto>());
tool.AddTransformer(new HttpTransform<PromptDto, string>(openAiClient));

var result = await tool.ExecuteAsync("Long text to summarize...");

API Aggregation (Fan-out β†’ Aggregate)

var pipeline = PipelineBuilder
    .From(new HttpSelector<User>("https://users.api.com"))
    .Transform(new MapsterTransform<User, EnrichedUser>())
    .Transform(new PollyResilienceTransform<EnrichedUser>(resiliencePipeline));
await pipeline.To(new Sink<EnrichedUser>(user => enrichedUsers.Add(user)));

Error Persistence with DeadLetterSink

var pipeline = PipelineBuilder
    .From(new HttpSelector<Order>("https://api.example.com/orders"))
    .Transform(new OrderValidator())
    .WithOptions(o => o.ContinueOnError = true);
await pipeline.To(new DeadLetterSink<Order>("failed_orders.json"));

Getting Started | Installation

# Core engine (zero dependencies)
dotnet add package SmartPipe.Core

# Extensions (Http, EF Core, Dapper, JSON, CSV, Mapster, Polly)
dotnet add package SmartPipe.Extensions

First Pipeline (5 lines)

using SmartPipe.Core;
using SmartPipe.Extensions.Selectors;
using SmartPipe.Extensions.Transforms;
using SmartPipe.Extensions.Sinks;

var pipeline = PipelineBuilder
    .From(new HttpSelector<MyDto>("https://api.example.com/data"))
    .Transform(new JsonTransform<MyDto, MyEntity>())
    .WithOptions(o => o.MaxDegreeOfParallelism = 4);
await pipeline.To(new LoggerSink<MyEntity>(logger));

ASP.NET Core BackgroundService

public class PipelineWorker : BackgroundService
{
    protected override async Task ExecuteAsync(CancellationToken ct)
    {
        var pipeline = PipelineBuilder
            .From(new EfCoreSelector<Order>(_dbContext))
            .Transform(new MapsterTransform<Order, OrderDto>())
            .WithOptions(o => o.MaxDegreeOfParallelism = 8);
        await pipeline.To(new HttpSink<OrderDto>(_httpClient, "https://api.dest.com"));
    }
}

SmartPipe Architecture

Overview

SmartPipe is a streaming pipeline engine built on System.Threading.Channels. It consists of 24 integrated components organized in a resilience pipeline order.

## Pipeline Flow
## Pipeline Flow
ISource<T> (or RunInBackground)
    β”‚
    β–Ό
Bounded Channel (or Rendezvous Channel)
    β”‚
    β–Ό
BackpressureStrategy (Dual-threshold: Pause/Resume)
    β”‚
    β–Ό
DeduplicationFilter (Bloom, O(1)) + HyperLogLogEstimator
    β”‚
    β–Ό
AdaptiveParallelism (Little's Law)
    β”‚
    β–Ό
CircuitBreaker (Lock-free, Closed→Open→HalfOpen)
    β”‚
    β–Ό
MiddlewareTransformer (Func<T,T>) + ITransformer (ValueTask)
    β”‚
    β–Ό
RetryQueue (Jitter + Exponential Backoff)
    β”‚
    β–Ό
Bounded Channel
    β”‚
    β–Ό
ISink<T> (Logger, DeadLetter, HealthChecks)
    β”‚
    β–Ό
AsChannelReader() β†’ SignalR/gRPC

Resilience Pipeline Order

  1. TotalRequestTimeout β€” maximum time for entire pipeline
  2. CircuitBreaker β€” stops processing on high failure rate
  3. RetryQueue β€” delays and retries transient errors
  4. AttemptTimeout β€” per-transformer timeout
  5. DeadLetterSink β€” captures exhausted retries for later replay
  6. LivenessCheck β€” detects stalled pipeline
  7. ReadinessCheck β€” detects overloaded pipeline

Component Overview

Component Type Memory Performance
DeduplicationFilter Bloom filter O(1) 20.04 ns
ObjectPool Lock-free O(n) 15.63 ns
CircuitBreaker Lock-free (Interlocked) O(n) 27.76 ns
RetryQueue Lock-free (Channel) O(n) 69.16 ns
ExponentialHistogram Percentiles O(logΒ² n) < 100 ns
JumpHash Sharding O(1) < 10 ns
CuckooFilter Dedup + delete O(1) < 50 ns
ReservoirSampler Sampling O(k) < 10 ns
HyperLogLogEstimator Count-Distinct O(1) < 50 ns
DeadLetterSink Error persistence O(n) β€”
ChannelMerge Stream merging O(n) β€”

Extension Architecture

Extensions follow the Selection Pattern β€” a single package with categorized components:

  • Selectors β€” data sources (Http, EF Core, Dapper)
  • Transforms β€” data transformers (JSON, CSV, Mapster, Compression, Polly, Middleware)
  • Sinks β€” data destinations (Logger, DeadLetter)
  • Health β€” Kubernetes probes (Liveness, Readiness)
  • Streaming β€” ChannelMerge, RunInBackground, AsChannelReader

Instead of 12 separate NuGet packages, SmartPipe uses a single SmartPipe.Extensions package with the Selection Pattern:

SmartPipe.Extensions/
β”œβ”€β”€ Selectors/          ← Data sources
β”‚   β”œβ”€β”€ HttpSelector
β”‚   β”œβ”€β”€ EfCoreSelector
β”‚   └── DapperSelector
β”œβ”€β”€ Transforms/         ← Data transformers
β”‚   β”œβ”€β”€ JsonTransform
β”‚   β”œβ”€β”€ CsvTransform
β”‚   β”œβ”€β”€ MapsterTransform
β”‚   β”œβ”€β”€ CompressionTransform
β”‚   └── PollyResilienceTransform
└── Sinks/              ← Data destinations
    β”œβ”€β”€ LoggerSink      ← Structured logging
    └── DeadLetterSink  ← Failed items persistence
One package. All integrations. Zero boilerplate.

Requirements

  • .NET 10.0+
  • SmartPipe.Core: 0 dependencies
  • SmartPipe.Extensions: Polly, EF Core, Dapper, Mapster, CsvHelper
  • 215 tests, 96.4% code coverage

What's New in v1.0.3

  • 13 new features (215 tests, 96.3% coverage)
  • Middleware Transformer β€” Func<T,T> as lightweight ITransformer
  • Rendezvous Channel β€” (BoundedCapacity=0)
  • HyperLogLogEstimator β€” Count-Distinct with O(1) memory
  • Dual-threshold Watermark β€” Pause/Resume prevents oscillation
  • Liveness/Readiness Health Checks β€” Kubernetes-native
  • DeadLetterSink β€” failed items persistence
  • Data Lineage β€” provenance tracking in Metadata
  • ChannelMerge β€” merge two streams
  • RunInBackground() β€” streaming pipeline consumption
  • Hybrid Queue β€” FullMode option (Wait/DropOldest)
  • AsChannelReader() β€” SignalR/gRPC integration

What's New in v1.0.2

  • Lock-free RetryQueue
  • Lock-free CircuitBreaker
  • SmartPipeEventSource β€” monitor via dotnet-counters
  • SmartPipeHostedService β€” native ASP.NET Core integration
  • SmartPipeHealthCheck β€” pipeline health for YARP/Kubernetes
  • Adaptive EMA β€” dynamic Ξ± for spike detection
  • Dynamic Watermark β€” throughput-based backpressure
  • 96.3% code coverage (up from 86.5%)
  • 47 new tests, 0 regressions in benchmarks

Documentation

Acknowledgements

SmartPipe is built on ideas and research from:

  • Polly β€” resilience patterns for .NET (github.com/App-vNext/Polly)
  • System.Threading.Channels β€” lock-free producer/consumer infrastructure by Microsoft
  • OpenTelemetry β€” observability framework for cloud-native software
  • Little's Law β€” queue theory applied to adaptive parallelism (ACM Queue, 2025)
  • Bloom & Cuckoo Filters β€” probabilistic data structures for deduplication
  • ReTraced β€” three-level retry model inspiration
  • TheCodeMan β€” production Channel pipeline patterns
  • Microsoft.Extensions.Resilience β€” resilience pipeline integration
  • OWASP β€” security patterns for secret detection
  • BenchmarkDotNet β€” performance measurement framework

License MIT License β€” see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET 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.
  • net10.0

    • No dependencies.

NuGet packages (21)

Showing the top 5 NuGet packages that depend on SmartPipe.Core:

Package Downloads
SmartPipe.Extensions

Compatibility facade and convenience bundle for SmartPipe.Core and its runtime integration packages. New applications should reference specific SmartPipe.Extensions.* packages. Retained 2.1.2 APIs use type forwarding or the frozen legacy DI/Hosting/Health cluster; removed HTTP/Polly APIs require migration and recompilation.

SmartPipe.Extensions.Json

System.Text.Json-based sources, sinks, transforms, and dead-letter persistence for SmartPipe.Core with trimming and NativeAOT support.

SmartPipe.Extensions.Transforms

Composable transforms for SmartPipe.Core.

SmartPipe.Extensions.Http

Streaming HTTP sources and sinks for SmartPipe.Core.

SmartPipe.Extensions.HealthChecks

Key-based liveness and readiness health checks for canonical SmartPipe pipelines.

GitHub repositories

This package is not used by any popular GitHub repositories.