Benzene.Core.MessageHandlers 0.0.2-alpha.1

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

Benzene

Build Status codecov NuGet License: MIT

Benzene is a hexagonal (ports-and-adapters) framework for C# built around a shared middleware pipeline — write your message handlers and cross-cutting concerns (logging, correlation IDs, validation, health checks) once, then run the same service behind AWS Lambda (API Gateway, SQS, SNS, Kafka, EventBridge), Azure Functions (HTTP, Event Hubs, Service Bus, Cosmos DB Change Feed, Queue/Blob Storage, Event Grid, Timer), or ASP.NET Core without rewriting any of it.

Why Benzene?

  • Write a message handler once, against a topic — swap the transport (HTTP, Lambda, SQS, SNS, Kafka...) without touching handler code
  • Cross-cutting concerns (correlation IDs, logging, validation, health checks) live in composable middleware, not scattered across handlers
  • New message handlers are discovered automatically by reflection — no manual routing tables to maintain
  • Multi-cloud by design: the same handlers run on AWS, Azure, or a plain ASP.NET Core host
  • Honest by design: Benzene abstracts your business logic, never the transport or the database — so you keep every cloud-native feature of the tools you chose (see the Capability Matrix)
  • Designed to outlive its .NET implementation: every concept, wire format, and status is written down independently of the C# API, so a future port to another language is a translation of a design, not a rewrite (see the Benzene Specification)

Quickstart

Benzene's packages are published as prerelease (-alpha) versions until 1.0, so --prerelease is required:

dotnet add package Benzene.AspNet.Core --prerelease

A message handler, mapped to a topic:

[Message("hello:world")]
[HttpEndpoint("GET", "/hello/{name}")]
public class HelloWorldMessageHandler : IMessageHandler<HelloWorldRequest, HelloWorldResponse>
{
    public Task<IBenzeneResult<HelloWorldResponse>> HandleAsync(HelloWorldRequest message)
    {
        return Task.FromResult(BenzeneResult.Ok(new HelloWorldResponse { Message = $"Hello {message.Name}!" }));
    }
}

Wired into an ASP.NET Core host (in Program.cs):

var builder = WebApplication.CreateBuilder(args);

builder.Services.UsingBenzene(x => x
    .AddMessageHandlers(typeof(HelloWorldMessageHandler).Assembly));

var app = builder.Build();

app.UseBenzene(benzene => benzene
    .UseHttp(http => http
        .UseMessageHandlers()));

app.Run();

See Getting Started for the full five-minute walkthrough (including the request/response message types omitted above for brevity), and examples/ for complete, runnable sample projects covering AWS Lambda, Azure Functions, ASP.NET Core, Kafka, and more.

How it fits into hexagonal architecture

Your message handlers are the application core — they depend only on Benzene.Abstractions types (IMessageHandler<TRequest, TResponse>, IBenzeneResult<T>) and whatever port interfaces you define for your own dependencies (databases, other services). Each transport (Benzene.AspNet.Core, Benzene.Aws.Lambda.*, Benzene.Azure.*) is an adapter that converts its native request into a message and routes it to the matching handler via UseMessageHandlers(), then converts the IBenzeneResult back into a transport-native response. Middleware in Benzene.Core.Middleware provides the pipeline that every adapter shares, so correlation IDs, logging, validation, and health checks are written once and apply everywhere.

Documentation

Full documentation is available in docs/, including:

Installation

dotnet add package Benzene.Core --prerelease

Plus whichever transport and integration packages your service needs (Benzene.AspNet.Core, Benzene.Aws.Lambda.ApiGateway, Benzene.Azure.Function.Core, Benzene.FluentValidation, etc.) — see docs/ for the relevant package per adapter.

Requires .NET 10.

Contributing

Contributions are welcome — see CONTRIBUTING.md for setup, conventions, and what to read before sending a change.

License

MIT — 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.

NuGet packages (51)

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

Package Downloads
Benzene.Http

Package Description

Benzene.HealthChecks

Package Description

Benzene.Xml

Package Description

Benzene.Schema.OpenApi

Package Description

Benzene.Aws.Sqs

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.2.18-alpha 277 7/14/2026
0.0.2.17-alpha 231 7/13/2026
0.0.2.16-alpha 229 7/11/2026
0.0.2.15-alpha 157 2/7/2025
0.0.2.14-alpha 126 2/7/2025
0.0.2.13-alpha 138 2/6/2025
0.0.2.12-alpha 131 12/19/2024
0.0.2-alpha.1 0 7/23/2026