ProtoTest.Messaging.RabbitMq
1.0.1
dotnet add package ProtoTest.Messaging.RabbitMq --version 1.0.1
NuGet\Install-Package ProtoTest.Messaging.RabbitMq -Version 1.0.1
<PackageReference Include="ProtoTest.Messaging.RabbitMq" Version="1.0.1" />
<PackageVersion Include="ProtoTest.Messaging.RabbitMq" Version="1.0.1" />
<PackageReference Include="ProtoTest.Messaging.RabbitMq" />
paket add ProtoTest.Messaging.RabbitMq --version 1.0.1
#r "nuget: ProtoTest.Messaging.RabbitMq, 1.0.1"
#:package ProtoTest.Messaging.RabbitMq@1.0.1
#addin nuget:?package=ProtoTest.Messaging.RabbitMq&version=1.0.1
#tool nuget:?package=ProtoTest.Messaging.RabbitMq&version=1.0.1
ProtoTest.Messaging.RabbitMq
The RabbitMQ adapter for the messaging capability: publish to exchanges and tap events through a per-test queue per awaited destination.
dotnet add package ProtoTest.Messaging.RabbitMq
Quick start
builder.AddMessaging(messaging => messaging.UseRabbitMq(options =>
{
// Or set ProtoTest:Messaging:RabbitMq:ConnectionString for the environment.
options.ConnectionString = "amqp://guest:guest@localhost:5672/";
}));
For a broker the run owns, add the container as infrastructure instead — the started connection string reaches both the adapter and an in-process application, and an explicitly configured string still wins:
builder.AddInfrastructure(RabbitMqBroker.Container(),
RabbitMqOptions.ConnectionStringSetting, "Messaging:RabbitMq:ConnectionString");
builder.AddMessaging(messaging => messaging.UseRabbitMq());
What it adds
- Adapter —
UseRabbitMq(configure?)on the messaging builder attaches aRabbitMqMessageBroker; the first registration wins and allAddMessagingrepeat rules apply. - Publishing — sends to the exchange named like the destination with the destination as routing key, UTF-8 payloads and
ContentTypedefaulting toapplication/json. - Per-test tap — the test's consumer owns its own channel on the run's shared connection and declares one exclusive, auto-delete queue per awaited destination, bound with the destination routing key and with
#; every queue is deleted when the test ends. - Connection — one shared connection for the run, released as the run-scoped
messaging:brokerresource;RabbitMqOptions.ConnectionStringSettingnames the key a container fills. - Tracing — the same
messaging.publish/messaging.awaitoperations andmessaging.publish/messaging.receiveobservations, withmessaging.system = "RabbitMQ".
Configuration
| Key | Type | Default |
|---|---|---|
ProtoTest:Messaging:RabbitMq:ConnectionString |
string |
amqp://guest:guest@localhost:5672/ |
ProtoTest:Messaging:RabbitMq:PollInterval |
TimeSpan |
00:00:00.025 |
A tap has no history: a destination prepared lazily at the await only sees later messages, awaiting drains and discards non-matching messages, and the exchange must already exist — the adapter does not declare application exchanges.
Learn more
| 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 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. |
-
net10.0
- ProtoTest.Core (>= 1.0.1)
- ProtoTest.Messaging (>= 1.0.1)
- RabbitMQ.Client (>= 6.8.1)
-
net8.0
- ProtoTest.Core (>= 1.0.1)
- ProtoTest.Messaging (>= 1.0.1)
- RabbitMQ.Client (>= 6.8.1)
-
net9.0
- ProtoTest.Core (>= 1.0.1)
- ProtoTest.Messaging (>= 1.0.1)
- 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.