Streamline.Messaging 1.0.7

dotnet add package Streamline.Messaging --version 1.0.7
                    
NuGet\Install-Package Streamline.Messaging -Version 1.0.7
                    
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="Streamline.Messaging" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Streamline.Messaging" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Streamline.Messaging" />
                    
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 Streamline.Messaging --version 1.0.7
                    
#r "nuget: Streamline.Messaging, 1.0.7"
                    
#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 Streamline.Messaging@1.0.7
                    
#: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=Streamline.Messaging&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Streamline.Messaging&version=1.0.7
                    
Install as a Cake Tool

Streamline.Messaging

A lightweight and elegant abstraction over NATS for .NET — ideal for fast integration between services without boilerplate code or bloated configuration.

Forget about verbose setups. Just tell the system what message you're handling or producing, and Streamline.Messaging takes care of the rest.

Not Kafka. Not RabbitMQ.
Just a clean, minimal messaging layer for developers who care about writing readable and maintainable code.


📦 Features

  • Simple & intuitive usage
  • Easy message handler registration
  • Publish/Subscribe with queues or topics
  • Fast to integrate and great for learning messaging in microservices

✨ Getting Started

1. Install via NuGet

dotnet add package Streamline.Messaging

2. Define a Message

public sealed record OrderCreatedEvent(string OrderId) : IMessage;

3. Create a Message Handler

public sealed class OrderCreatedHandler(IOrderService service): 
    IMessageHandler<OrderCreatedEvent>
{
    public async Task HandleAsync(OrderCreatedEvent message, CancellationToken token = default)
    {
        Console.WriteLine($"Handling order: {message.OrderId}");
    }
}

4. Configure Consumers and Producers

Inside your Program.cs

builder.Services.AddMessaging(options =>
{
    options.AddConsumer<OrderCreatedEvent, OrderCreatedHandler>()
           .FromQueue("orders.created"); // You can also use .FromTopic("some.topic") if preferred.

    options.AddProducer<OrderCreatedEvent>()
           .ToTopic("orders.created");
});

5. Publish a Message

public sealed class SampleHandler(IMessageProducer messageProducer) :
    IRequestHandler<OrderCreationRequest, Result>
{
    public async Task<Result> HandleAsync(OrderCreationRequest request, CancellationToken token)
    {
        var @event = new OrderCreatedEvent
        {
            OrderId = "order_XXXXXXXXX"
        };

        // You can also pass the cancellation token if needed:
        // await messageProducer.PublishAsync(@event, token);

        await messageProducer.PublishAsync(@event);

        return Result.Success();
    }
}

⚠️ Note About Abstractions

If you prefer to keep your domain and application layers decoupled from infrastructure, or are following Clean Architecture principles, consider using the separate package:

Streamline.Messaging.Abstractions

This package provides only the messaging interfaces and contracts — no implementation. Perfect for defining messaging contracts in shared libraries, writing unit tests, and keeping your domain clean.

Installation

You can install the abstractions package via NuGet:

dotnet add package Streamline.Messaging.Abstractions

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 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. 
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
1.0.7 367 7/20/2025
1.0.0.4 272 7/19/2025
1.0.0 270 7/19/2025