Making.RabbitMQ
1.0.4-preview
dotnet add package Making.RabbitMQ --version 1.0.4-preview
NuGet\Install-Package Making.RabbitMQ -Version 1.0.4-preview
<PackageReference Include="Making.RabbitMQ" Version="1.0.4-preview" />
<PackageVersion Include="Making.RabbitMQ" Version="1.0.4-preview" />
<PackageReference Include="Making.RabbitMQ" />
paket add Making.RabbitMQ --version 1.0.4-preview
#r "nuget: Making.RabbitMQ, 1.0.4-preview"
#:package Making.RabbitMQ@1.0.4-preview
#addin nuget:?package=Making.RabbitMQ&version=1.0.4-preview&prerelease
#tool nuget:?package=Making.RabbitMQ&version=1.0.4-preview&prerelease
Making.RabbitMQ
RabbitMQ client utilities and extensions for the Making framework.
Overview
Making.RabbitMQ provides essential RabbitMQ client utilities and connection management for the Making framework. It offers a robust foundation for building messaging solutions with connection pooling, retry logic, and configuration management.
Features
- Connection Management: Robust RabbitMQ connection handling with automatic reconnection
- Configuration Support: Easy configuration through options pattern
- Connection Pooling: Efficient connection reuse and management
- Retry Logic: Built-in retry mechanisms for failed operations
- Logging Integration: Comprehensive logging for debugging and monitoring
- Dependency Injection: Full DI container integration
Installation
dotnet add package Making.RabbitMQ
Usage
Configuration
{
"RabbitMQ": {
"ConnectionString": "amqp://guest:guest@localhost:5672/",
"VirtualHost": "/",
"Username": "guest",
"Password": "guest",
"HostName": "localhost",
"Port": 5672,
"RequestedHeartbeat": 60,
"NetworkRecoveryInterval": 10,
"AutomaticRecoveryEnabled": true,
"TopologyRecoveryEnabled": true
}
}
Register Services
services.AddMakingRabbitMQ(configuration);
Using RabbitMQ Connection
public class MessageService
{
private readonly IRabbitMqConnection _connection;
private readonly ILogger<MessageService> _logger;
public MessageService(IRabbitMqConnection connection, ILogger<MessageService> logger)
{
_connection = connection;
_logger = logger;
}
public async Task SendMessageAsync(string queueName, string message)
{
using var channel = _connection.CreateChannel();
// Declare queue
channel.QueueDeclare(
queue: queueName,
durable: true,
exclusive: false,
autoDelete: false,
arguments: null);
// Prepare message
var body = Encoding.UTF8.GetBytes(message);
var properties = channel.CreateBasicProperties();
properties.Persistent = true;
// Publish message
channel.BasicPublish(
exchange: "",
routingKey: queueName,
basicProperties: properties,
body: body);
_logger.LogInformation("Message sent to queue {QueueName}", queueName);
}
public async Task<string> ReceiveMessageAsync(string queueName)
{
using var channel = _connection.CreateChannel();
// Declare queue
channel.QueueDeclare(
queue: queueName,
durable: true,
exclusive: false,
autoDelete: false,
arguments: null);
// Get message
var result = channel.BasicGet(queueName, autoAck: true);
if (result != null)
{
var message = Encoding.UTF8.GetString(result.Body.ToArray());
_logger.LogInformation("Message received from queue {QueueName}", queueName);
return message;
}
return null;
}
}
Advanced Usage with Options
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.Configure<RabbitMqOptions>(options =>
{
options.ConnectionString = "amqp://localhost:5672";
options.AutomaticRecoveryEnabled = true;
options.NetworkRecoveryInterval = TimeSpan.FromSeconds(10);
options.RequestedHeartbeat = TimeSpan.FromSeconds(60);
});
services.AddMakingRabbitMQ();
}
}
Requirements
- .NET Standard 2.0+
- RabbitMQ Server
- RabbitMQ.Client
- Microsoft.Extensions.DependencyInjection
- Microsoft.Extensions.Options.ConfigurationExtensions
- Microsoft.Extensions.Logging
- System.Text.Json
- Making.Core
License
This project is part of the Making framework.
Product | Versions 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 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. |
-
net8.0
- Making.Core (>= 1.0.4-preview)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- RabbitMQ.Client (>= 7.1.2)
- System.Text.Json (>= 8.0.0)
-
net9.0
- Making.Core (>= 1.0.4-preview)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.Logging (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- RabbitMQ.Client (>= 7.1.2)
- System.Text.Json (>= 9.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Making.RabbitMQ:
Package | Downloads |
---|---|
Making.Events.RabbitMQ
RabbitMQ event bus implementation for the Making framework |
|
Making.EventBus.RabbitMQ
RabbitMQ event bus implementation for the Making framework |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.4-preview | 11 | 8/10/2025 |
1.0.1-preview | 319 | 7/25/2025 |
1.0.0-preview | 394 | 7/25/2025 |