VibeMQ — .NET Message Broker
VibeMQ is a simple yet reliable message broker for .NET applications using TCP as transport. It supports publish/subscribe (pub/sub), queues with delivery guarantees, automatic reconnections, and other essential features for building distributed systems.
🚀 Quick Start
Install via NuGet:
dotnet add package VibeMQ.Server
dotnet add package VibeMQ.Client
Start the server:
using VibeMQ.Server;
using VibeMQ.Core.Enums;
var broker = BrokerBuilder.Create()
.UsePort(8080)
.UseAuthentication("my-secret-token")
.ConfigureQueues(options => {
options.DefaultDeliveryMode = DeliveryMode.RoundRobin;
options.MaxQueueSize = 10_000;
})
.Build();
await broker.RunAsync(cancellationToken);
Connect the client:
using VibeMQ.Client;
await using var client = await VibeMQClient.ConnectAsync(
"localhost",
8080,
new ClientOptions { AuthToken = "my-secret-token" }
);
// Publish a message
await client.PublishAsync("notifications", new { Title = "Hello", Body = "World" });
// Subscribe to messages
await using var subscription = await client.SubscribeAsync<dynamic>(
"notifications",
msg => {
Console.WriteLine($"Received: {msg.Title}");
return Task.CompletedTask;
}
);
📋 Table of Contents
Getting Started
Core Concepts
Setup & Usage
Monitoring & Operations
Additional Resources
🎯 Key Features
Message Delivery Modes:
Round-robin — each message delivered to one subscriber (cyclically)
Fan-out with acknowledgment — to all subscribers with delivery guarantee
Fan-out without acknowledgment — to all subscribers without confirmation
Priority-based — delivery by priority (Critical > High > Normal > Low)
Delivery Guarantees:
Acknowledgments (ACK) from receivers
Automatic retry attempts with exponential backoff
Dead Letter Queue for failed messages
In-flight message tracking
Reliability:
Keep-alive (PING/PONG) for connection maintenance
Automatic reconnections on client side
Graceful shutdown without message loss
Health checks for orchestrators
Security:
Token-based authentication
TLS/SSL encryption support
Rate limiting for overload protection
Monitoring:
Built-in performance metrics
HTTP endpoints for health checks
Statistics for queues and connections
📦 Modular Architecture
VibeMQ consists of several NuGet packages:
💡 Usage Examples
Server with Dependency Injection:
using VibeMQ.Server.DependencyInjection;
using VibeMQ.Core.Enums;
var host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services => {
services.AddVibeMQBroker(options => {
options.Port = 8080;
options.EnableAuthentication = true;
options.AuthToken = "my-secret-token";
options.QueueDefaults.DefaultDeliveryMode = DeliveryMode.RoundRobin;
});
})
.Build();
await host.RunAsync();
Client with Dependency Injection:
using VibeMQ.Client;
using VibeMQ.Client.DependencyInjection;
var host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services => {
services.AddVibeMQClient(settings => {
settings.Host = "localhost";
settings.Port = 8080;
settings.ClientOptions.AuthToken = "my-secret-token";
});
})
.Build();
// Option A: inject IVibeMQClient (shared, lazy-connected)
var client = host.Services.GetRequiredService<IVibeMQClient>();
await client.PublishAsync("notifications", new { Title = "Hello" });
// Option B: create a dedicated client (you dispose it)
var factory = host.Services.GetRequiredService<IVibeMQClientFactory>();
await using var dedicatedClient = await factory.CreateAsync();
🔗 Links
📄 License
VibeMQ is distributed under the MIT License. See LICENSE file for details.