Raycynix.Extensions.Messaging 0.11.0

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

Raycynix.Extensions.Messaging

TeamCity build status

Raycynix.Extensions.Messaging contains the transport-agnostic messaging foundation for Raycynix applications.

What it contains

  • AddRaycynixMessaging(...)
  • MessagingBuilder
  • MessagingConfiguration
  • JsonMessagingConfiguration
  • GrpcMessagingConfiguration
  • IMessageSerializer
  • IMessageEnvelopeFactory
  • IRequestEnvelopeFactory
  • IDirectRequestClient
  • IMessageCodec
  • IMessageCodecResolver
  • IMessagePublisher
  • IMessageHandler<TMessage>
  • MessageEnvelope<TMessage>
  • RequestEnvelope<TRequest>
  • ResponseEnvelope<TResponse>
  • SerializedMessage
  • built-in JSON serialization through Newtonsoft.Json
  • delegate-based gRPC/protobuf codec registration through AddGrpcMessage<TMessage>(...)
  • transport-neutral message envelope creation and serialization
  • transport-neutral direct request/response abstractions
  • incoming dispatch pipeline with retry, deduplication, and idempotency foundations
  • optional metrics/observability integration
  • scoped envelope/request factories that can project ambient security context safely
  • in-memory inbox/outbox and outbox recovery foundation with dispatch leases

What it does not contain

  • broker-specific Kafka client setup
  • broker-specific RabbitMQ client setup
  • persistent inbox/outbox storage
  • database-backed transactional coordination
  • broker topology management beyond provider packages

Usage

Register the base package and optional codecs:

builder.Services.AddRaycynixMessaging(builder.Configuration, options =>
{
    options.DefaultFormat = MessageFormat.Json;
})
.AddGrpcMessage<MyGrpcMessage>(
    message => message.ToByteArray(),
    payload => MyGrpcMessage.Parser.ParseFrom(payload.Span));

Register direct request handlers in the shared pipeline:

builder.Services.AddRaycynixMessaging(builder.Configuration)
    .AddRequestHandler<GetOrderRequest, GetOrderResponse, GetOrderRequestHandler>("orders.v1/get");

Create and publish a message through a broker transport:

public class OrderService(
    IMessageEnvelopeFactory envelopeFactory,
    IMessagePublisher messagePublisher)
{
    public async Task PublishOrderCreatedAsync(OrderCreatedMessage message, CancellationToken cancellationToken)
    {
        var envelope = envelopeFactory.Create(
            message,
            destination: "orders.created",
            format: MessageFormat.Json);

        await messagePublisher.PublishAsync(envelope, cancellationToken);
    }
}

Create and send a direct request through HttpJson or Grpc transport:

public class CatalogGateway(
    IRequestEnvelopeFactory envelopeFactory,
    IDirectRequestClient directRequestClient)
{
    public async Task<CatalogItemResponse> GetAsync(string sku, CancellationToken cancellationToken)
    {
        var request = envelopeFactory.Create(
            new CatalogItemRequest(sku),
            destination: "catalog/get-item",
            format: MessageFormat.Json);

        var response = await directRequestClient.SendAsync<CatalogItemRequest, CatalogItemResponse>(
            request,
            cancellationToken);

        return response.Response;
    }
}

Register and dispatch incoming handlers:

builder.Services.AddRaycynixMessaging(builder.Configuration)
    .AddMessageHandler<OrderCreatedMessage, OrderCreatedHandler>();

public sealed class OrderConsumer(IMessageDispatcher dispatcher)
{
    public async Task ConsumeAsync(OrderCreatedMessage message, CancellationToken cancellationToken)
    {
        var envelope = new MessageEnvelope<OrderCreatedMessage>
        {
            Message = message,
            Destination = "orders.created",
            Format = MessageFormat.Json,
            MessageId = Guid.NewGuid().ToString("N")
        };

        await dispatcher.DispatchAsync(envelope, cancellationToken);
    }
}

Contract metadata and propagation headers are added automatically:

  • X-Contract-Name
  • X-Contract-Version
  • X-Correlation-Id
  • X-Message-Source
  • traceparent
  • service identity headers when ISecurityContext is available

For a concrete transport, add one of the provider packages:

  • Raycynix.Extensions.Messaging.Kafka
  • Raycynix.Extensions.Messaging.RabbitMQ
  • Raycynix.Extensions.Messaging.HttpJson
  • Raycynix.Extensions.Messaging.Grpc

The base package also includes:

  • inbound security-header validation
  • scoped inbound ISecurityContext projection from messaging headers
  • declarative handler authorization using shared security attributes
  • background outbox recovery service for in-memory recovery scenarios
  • dispatch leasing to prevent duplicate outbox recovery publishes
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 (5)

Showing the top 5 NuGet packages that depend on Raycynix.Extensions.Messaging:

Package Downloads
Raycynix.Extensions.Messaging.HttpJson

HTTP JSON direct request/response transport for Raycynix messaging with shared envelope propagation, HttpClient integration, and configuration-based registration.

Raycynix.Extensions.Messaging.Database

Database-backed messaging inbox and outbox persistence with ambient unit-of-work support, optimistic concurrency leasing, retention cleanup, and configuration-based setup on the shared Raycynix DatabaseContext.

Raycynix.Extensions.Messaging.Grpc

gRPC direct request/response transport for Raycynix messaging with logical operation routing, generated client integration, and configuration-based registration.

Raycynix.Extensions.Messaging.RabbitMQ

RabbitMQ transport integration for Raycynix messaging with topology bootstrap, inbound consumer hosting, retry/dead-letter handling, and configuration-based setup.

Raycynix.Extensions.Messaging.Kafka

Kafka transport integration for Raycynix messaging with publisher registration, inbound consumer hosting, retry/dead-letter support, and configuration-based setup.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 40 4/8/2026
0.11.0 43 4/8/2026