CrossQueue.Hub 1.1.5-rc

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

CrossQueue.Hub

NuGet NuGet Downloads

CrossQueue.Hub

CrossQueue.Hub is a lightweight .NET library that provides a unified abstraction for working with multiple message brokers such as RabbitMQ, Apache Kafka, and AWS SQS.
It allows you to publish and subscribe to messages in a transport-agnostic way, keeping your application code clean and scalable.


🚀 Features

  • Unified interface for RabbitMQ, Kafka, and AWS SQS.
  • JSON message serialization/deserialization built-in.
  • Publisher/Subscriber abstraction for simplicity.
  • Easily extendable to other message brokers.
  • Configurable and production-ready.

📦 Installation

dotnet add package CrossQueue.Hub

⚡ Usage

1. Configure the broker in your appsettings.json

{
  "CrossQueueHub": {
    "RabbitMQ": {
        "ConnectionString": "amqp://guest:guest@localhost:5672/",
        "DefaultExchange": "default-exchange",
        "DefaultExchangeType": "fanout",
        "Durable": true,
        "PublishRetryCount": 5,
        "PublishRetryDelayMs": 200,
        "ConsumerRetryCount": 5,
        "ConsumerRetryDelayMs": 500,
        "DeadLetterExchange": "dlx"
    }
  }
}

2. Register CrossQueue.Hub in Program.cs

The are two overloads of the AddCrossQueueHubRabbitMqBus() method

// Using Action<CrossQueueOptions> overload for code-based config
builder.Services.AddRabbitMqBus(opt =>
{
    opt.ConnectionString = "amqp://guest:guest@localhost:5672/";
    opt.DefaultExchange = "myapp.exchange";
    opt.DefaultExchangeType = ExchangeType.Topic;
});

// Using IConfiguration overload
builder.Services.AddRabbitMqBus(builder.Configuration);

// OR using custom section name.
// In this case, your section in the appsettings.json will be 'MyCustomRabbitMq' instead of 'CrossQueueHub'
builder.Services.AddRabbitMqBus(builder.Configuration, "MyCustomRabbitMq");

3. Inject the RabbitMQPubSub class into the constructor of the class you want to use it.

public class RabbitMQPubSubTest
{
  private readonly IRabbitMQPubSub _pubSub;

  public RabbitMQPubSubUser(IRabbitMQPubSub pubSub)
  {
    _pubSub = pubSub;
  }
}

4. Publish a message

await _pubSub.PublishAsync(new { Text = "Hello World" }, routingKey: "my.route");

5. Subscribe to a message

_pubSub.Subscribe<dynamic>("my.queue", async msg =>
{
    Console.WriteLine($"Received: {msg.Text}");
    await Task.CompletedTask;
}, routingKey: "my.route");

🛠 Supported Brokers

  • ✅ RabbitMQ

📖 Roadmap

  • Apache Kafka
  • AWS SQS
  • Add support for Azure Service Bus.
  • Metrics & observability integrations.

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.


📜 License

MIT License

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.1.8 242 8/26/2025
1.1.7 151 8/17/2025
1.1.6-rc 150 8/17/2025
1.1.5-rc 122 8/17/2025
1.1.4-rc 120 8/17/2025
1.1.3-rc 123 8/17/2025
1.0.3-rc 122 8/17/2025
1.0.2-rc 108 8/16/2025
1.0.1-rc 74 8/16/2025
1.0.0-rc 78 8/16/2025