Raycynix.Extensions.Messaging 2.2.0

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

Raycynix.Extensions.Messaging

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
  • optional Microsoft ILogger<T> diagnostics for publish, dispatch, incoming processing, and outbox recovery
  • 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

Example appsettings.json:

{
  "MessagingConfiguration": {
    "SourceName": "orders-service",
    "DefaultFormat": "Json",
    "Outbox": {
      "Enabled": true,
      "EnableRecovery": true,
      "AutoDispatchOnPublish": false
    },
    "IncomingProcessing": {
      "TrustedSources": [
        "orders.service"
      ]
    }
  }
}

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

If you need durable inbox and outbox storage instead of the built-in in-memory implementation, add Raycynix.Extensions.Messaging.Database on top of the shared database infrastructure.

Logging

The package uses optional Microsoft ILogger<T> diagnostics when logging is registered in the application. No Raycynix logging provider is required.

Diagnostics cover message publishing decisions, dispatch attempts, retry decisions, incoming processing, inbox/outbox decisions, and outbox recovery cycles. Message payloads, header values, security header values, and serialized content are not logged.

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.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.HttpJson

HTTP JSON direct request/response transport for Raycynix messaging with shared envelope propagation, HttpClient 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.Grpc

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

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
2.2.0 59 6/23/2026
1.0.1 175 4/20/2026 1.0.1 is deprecated because it is no longer maintained.
1.0.0 173 4/8/2026 1.0.0 is deprecated because it is no longer maintained.
0.11.0 170 4/8/2026 0.11.0 is deprecated because it is no longer maintained.

Starts unified versioning for Raycynix packages from this release and adds optional Microsoft.Extensions.Logging diagnostics.