RadHopper.RabbitMQ 0.1.2

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

RadHopper

RadHopper is a lightweight .NET package for registering and running message consumers.
It currently supports RabbitMQ, with additional transports planned.

The focus is on simple consumer registration and clear, explicit usage.

Basic Usage

Register RadHopper and configure the RabbitMQ transport during startup:

services.AddRadHopper(config =>
{
    // Batch size for batch consumers, otherwise used as a concurrency limit
    config.DefaultBatchSize = 100; // Default = ProcessorCount

    // Maximum wait time (in ms) before a batch is consumed
    config.DefaultWaitTimeMs = 500; // Default = 1 second

    // Whether messages should be requeued when an error occurs
    config.RequeueOnError = true; // Default = true

    // When false, messages may be discarded after being requeued once
    // When true, messages are left unacknowledged instead
    config.NeverDiscard = false; // Default = false.

    var factory = new ConnectionFactory // RabbitMQ.Client.ConnectionFactory
    {
        HostName = "localhost"
    };

    var transport = new RabbitMqTransport(config, factory);

    transport.AddReceiveEndpoint<SampleConsumer, SampleMessage>();

    return transport;
});

Consumers

ConsumerConfigurationAttribute is optional. Any values provided override the defaults from the RadHopper configuration.

Single Message Consumer

[ConsumerConfiguration(batchSize: 10)]
public class SampleConsumer : IConsumer<SampleMessage>
{
    public Task Consume(HopMessage<SampleMessage> message)
    {
        // Handle message
        return Task.CompletedTask;
    }
}

Batch consumers

[ConsumerConfiguration(batchSize: 100, waitTimeMs: 500)]
public class SampleConsumer : IBatchConsumer<SampleMessage>
{
    public Task Consume(HopMessage<SampleMessage>[] context)
    {
        Console.WriteLine($"Messages received: {context.Length}");
        return Task.CompletedTask;
    }
}

Messages & queues

Example:

[OnQueue("sample-queue")]
public record SampleMessage
{
    public Guid Id { get; init; }
    public DateTime CreatedAt { get; init; }
    public string Payload { get; init; } = string.Empty;
}

Queue naming

The onQueue attribute is used to set the queue name. This attribute is optional and by default the FullName of the type will be used.

You also have the option to specify the queue name explicitly when calling AddReceiveEndpoint or when publishing a message.

transport.AddReceiveEndpoint<SampleConsumer, SampleMessage>(
    "optional-queue-name"
);

Publishing Messages

After calling AddRadHopper an IPublisher will be registered as a singleton.

public interface IPublisher
{
    Task Publish<TO>(TO data, CancellationToken? cancellationToken = null);
    Task Publish<TO>(string queue, TO data, CancellationToken? cancellationToken = null);
    Task PublishRaw(string queue, string data, CancellationToken? cancellationToken = null);
}

Usage:

await publisher.Publish(new SampleMessage
{
    Id = Guid.NewGuid(),
    CreatedAt = DateTime.UtcNow,
    Payload = "Hello world"
});

// Or specify the queue name explicitly.
await publisher.Publish("optional-queue-name", message);

Transport Support

  • RabbitMQ ✅

⚠️ MVP / Early Preview

RadHopper is currently in MVP (Minimum Viable Product) stage.

Feedback and experimentation are encouraged.

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

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
0.1.2 95 3/11/2026
0.1.1 105 12/27/2025