Dreamine.Communication.RabbitMQ
1.0.0
dotnet add package Dreamine.Communication.RabbitMQ --version 1.0.0
NuGet\Install-Package Dreamine.Communication.RabbitMQ -Version 1.0.0
<PackageReference Include="Dreamine.Communication.RabbitMQ" Version="1.0.0" />
<PackageVersion Include="Dreamine.Communication.RabbitMQ" Version="1.0.0" />
<PackageReference Include="Dreamine.Communication.RabbitMQ" />
paket add Dreamine.Communication.RabbitMQ --version 1.0.0
#r "nuget: Dreamine.Communication.RabbitMQ, 1.0.0"
#:package Dreamine.Communication.RabbitMQ@1.0.0
#addin nuget:?package=Dreamine.Communication.RabbitMQ&version=1.0.0
#tool nuget:?package=Dreamine.Communication.RabbitMQ&version=1.0.0
Dreamine.Communication.RabbitMQ
Dreamine.Communication.RabbitMQ is part of the Dreamine Communication package family.
This package provides a RabbitMQ-based IMessageBus implementation for Dreamine Communication. It connects the common Dreamine message contract, MessageEnvelope, to RabbitMQ exchange, queue, and routing key based publish/subscribe messaging.
Description
RabbitMQ message bus adapter for Dreamine Communication.
This package is responsible for integrating RabbitMQ as an optional broker-backed message bus while keeping upper application layers dependent only on Dreamine.Communication.Abstractions.
Features
- RabbitMQ-based
IMessageBusimplementation - RabbitMQ connection lifecycle management
- Publish / Subscribe support through RabbitMQ exchange, queue, and routing key
MessageEnvelopeJSON serialization and deserialization- RabbitMQ topology declaration
- Exchange
- Queue
- Queue binding
- RabbitMQ options model
- RabbitMQ-specific communication exception type
- Communication Monitor sample compatibility
- Docker RabbitMQ server validation scenario
Package Role
Dreamine.Communication.Abstractions
↑
Dreamine.Communication.RabbitMQ
Dreamine.Communication.RabbitMQ depends on the abstraction contracts and provides a concrete RabbitMQ adapter.
Application code should depend on IMessageBus, MessageEnvelope, and shared communication contracts instead of depending directly on RabbitMQ-specific implementation types.
Main Components
RabbitMqMessageBus
RabbitMqMessageBus implements IMessageBus.
Responsibilities:
- Connect to a RabbitMQ server
- Declare exchange, queue, and queue binding topology
- Publish
MessageEnvelopemessages - Subscribe to a route and dispatch received messages to registered handlers
- Manage RabbitMQ connection and channel lifecycle
- Update connection state through the
ConnectionStatecontract
RabbitMqMessageBusOptions
Defines RabbitMQ connection and routing settings.
Typical fields:
HostNamePortVirtualHostUserNamePasswordExchangeNameQueueNameRoutingKey
RabbitMqCommunicationException
RabbitMQ-specific exception type for communication-layer failures.
Basic Usage
using Dreamine.Communication.Abstractions.Models;
using Dreamine.Communication.RabbitMQ.Buses;
using Dreamine.Communication.RabbitMQ.Options;
var bus = new RabbitMqMessageBus(
new RabbitMqMessageBusOptions
{
HostName = "localhost",
Port = 5672,
VirtualHost = "/",
UserName = "guest",
Password = "guest",
ExchangeName = "dreamine.sample.exchange",
QueueName = "dreamine.sample.queue",
RoutingKey = "dreamine.sample.route"
});
await bus.ConnectAsync();
await bus.SubscribeAsync(
"dreamine.sample.route",
async (message, cancellationToken) =>
{
var text = System.Text.Encoding.UTF8.GetString(message.Payload);
Console.WriteLine(text);
await Task.CompletedTask;
});
await bus.PublishAsync(
new MessageEnvelope
{
Name = "RabbitMQ.Publish",
Route = "dreamine.sample.route",
Payload = System.Text.Encoding.UTF8.GetBytes("test"),
Headers = new Dictionary<string, string>
{
["ContentType"] = "text/plain",
["Protocol"] = "RabbitMQ"
}
});
await bus.DisconnectAsync();
RabbitMQ Test Server
For local validation, RabbitMQ can be started through Docker.
docker run -d --name dreamine-rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
RabbitMQ Management UI:
http://localhost:15672
Default credentials:
guest / guest
Sample configuration:
Host localhost
Port 5672
VirtualHost /
User guest
Password guest
Exchange dreamine.sample.exchange
Queue dreamine.sample.queue
RoutingKey dreamine.sample.route
Validated Scenario
The RabbitMQ adapter has been validated with the Dreamine Communication sample.
Validated flow:
Connect
→ Subscribe
→ Publish
→ Receive
→ Monitor SEND / RECV log confirmation
Validated items:
- RabbitMQ Docker container startup
- RabbitMQ Management UI access
- RabbitMQ connection
- Exchange / queue / routing key topology declaration
- Message publish
- Message receive through subscription handler
MessageEnvelopeJSON serialization and deserialization- Communication Monitor channel state update
- Communication Monitor SEND / RECV message logs
Design Principles
- Keep broker-specific implementation isolated from upper layers.
- Depend on
Dreamine.Communication.Abstractionscontracts. - Keep package responsibilities small and explicit.
- Preserve one-way dependency flow.
- Keep RabbitMQ optional and replaceable.
- Allow application logic to use
IMessageBuswithout knowing RabbitMQ details. - Avoid leaking RabbitMQ.Client types into application-level code.
Dependencies
Dreamine.Communication.AbstractionsRabbitMQ.Client
Third-party License Notice
This package uses RabbitMQ.Client.
RabbitMQ.Client is dual-licensed under:
- Apache License 2.0
- Mozilla Public License 2.0
This package uses RabbitMQ.Client under the Apache License 2.0 option.
Target Framework
net8.0
Related Packages
Dreamine.Communication.AbstractionsDreamine.Communication.CoreDreamine.Communication.SocketsDreamine.Communication.SerialDreamine.Communication.RabbitMQDreamine.Communication.FullKitDreamine.Communication.Wpf
License
This project is licensed under the MIT License.
| 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 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. |
-
net8.0
- Dreamine.Communication.Abstractions (>= 1.0.0)
- RabbitMQ.Client (>= 6.8.1)
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.0.0 | 103 | 5/14/2026 |