Phema.RabbitMq
3.1.8
dotnet add package Phema.RabbitMq --version 3.1.8
NuGet\Install-Package Phema.RabbitMq -Version 3.1.8
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="Phema.RabbitMq" Version="3.1.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Phema.RabbitMq" Version="3.1.8" />
<PackageReference Include="Phema.RabbitMq" />
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 Phema.RabbitMq --version 3.1.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Phema.RabbitMq, 3.1.8"
#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 Phema.RabbitMq@3.1.8
#: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=Phema.RabbitMq&version=3.1.8
#tool nuget:?package=Phema.RabbitMq&version=3.1.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Phema.RabbitMQ
.NET Core strongly typed RabbitMQ integration library with quorum queues support
Concepts
Release immutability
- The topology for each release must be strictly defined and not changed during its existence
- Until application is running you can't:
- Cancel consumers
- Remove queues and exchanges
- Change bindings
- Until application is running you can't:
- The topology for each release must be strictly defined and not changed during its existence
Declarativeness and simplicity
- Intuitive RabbitMQ-close fluent interfaces
- Generic type checks
- Connection, Exchange, Queue, Consumer and Producer declaration classes
Installation
$> dotnet add package Phema.RabbitMQ
Usage (examples)
services.AddRabbitMQ(options =>
options.UseConnectionFactory(factory => ...))
.AddConnection(connection =>
{
// Enable type checks with .AddDirectExchange<TPayload>() extension
var exchange = connection.AddDirectExchange("exchange")
// .Internal()
// .NoWait()
// .Deleted()
.AutoDelete()
.Durable();
var queue = connection.AddQueue<Payload>("queue")
// .Exclusive()
// .Deleted()
// .NoWait()
// .Lazy()
// .MaxPriority(10)
// .TimeToLive(10000)
// .MaxMessageSize(1000)
// .MaxMessageCount(1000)
// .MessageTimeToLive(1000)
// .RejectPublish()
// .Quorum()
// .SingleActiveConsumer()
.AutoDelete()
.Durable()
// Type checks
.BoundTo(exchange);
// Type checks
connection.AddConsumer(queue)
// .Tagged("tag")
// .Prefetch(1)
// .Count(1)
// .Exclusive()
// .NoLocal()
// .AutoAck()
// .Requeue()
// .Priority(2)
.Count(2)
.Requeue()
.Subscribe(...);
// Type cheks
connection.AddProducer<Payload>(exchange)
// .WaitForConfirms()
// .Transactional()
// .Mandatory()
// .MessageTimeToLive(10000)
.Persistent();
});
// Get or inject
var producer = serviceProvider.GetRequiredService<IRabbitMQProducer>();
// Use
await producer.Publish(new Payload(), overrides => ...);
Supported
- Durable, internal, dead letter, bound and alternate exchanges
- Lazy, durable and exclusive queues
- Default, confirm and transactional channel modes
- Persistent producers
- Consumers priority
- Queue and message time to live
- Max message count and size limitations
- Batch produce
- App id declaration
- Reject-publish when queue is full
- Deleted operations
- NoWait operations
Queues
- Declare durable queue with
Durableextension - Declare exclusive queue with
Exclusiveextension - Declare queue without waiting with
NoWaitextension - Bind exchange to exchange with
BoundToextension - Declare lazy queue with
Lazyextension - Set queue max message count with
MaxMessageCountextension - Set queue max message size in bytes with
MaxMessageSizeextension - Set dead letter exchange with
DeadLetterToextension - Set queue ttl with
TimeToLiveextension - Set message ttl with
MessageTimeToLiveextension - Set queue max priority with
MaxPriorityextension - Explicitly delete queue with
Deletedextension - Delete queue automatically with
AutoDeleteextension - Add custom arguments with
Argumentextension
Exchanges
- Declare durable exchange with
Durableextension - Declare exchange without waiting with
NoWaitextension - Declare exchange as internal with
Internalextension - Delete exchange automatically with
AutoDeleteextension - Explicitly delete exchange with
Deletedextension - Bind exchange to exchange with
BoundToextension - Declare alternate exchange with
AlternateToextension - Add custom arguments with
Argumentextension - Declare exchange with
AddDirectExchange(...),AddFanoutExchange(...),AddHeadersExchange(...),AddTopicExchange(...)extensions
Consumers
- Tag consumers using
Taggedextension - Limit prefetch count with
Prefetchextension - Scale consumers by using
Countextension - Declare exclusive consume with
Exclusiveextension - Forbid to consume own producers with
NoLocalextension - When no need to ack explicitly use
AutoAckextension - Requeue messages on fail with
Requeueextension - Set consumer priority with
Priorityextension - Add custom arguments with
Argumentextension - All consumers start in
IHostedService
Producers
- Set routing key
RoutingKeyextension - Set mandatory with
Mandatoryextension - Set message priority with
Priorityextension - Set message ttl with
MessageTimeToLiveextension - Use channel transactional mode with
Transactionalextension - Use channel confirm mode with
WaitForConfirmsextension - Use message persistence with
Persistentextension - Configure headers with
Headerextension - Configure properties with
Propertyextension
Limitations
- No dynamic topology declaration by design, but you can use
IRabbitMQConnectionProviderfor that - No
correlation-id's - No
message-id's - No
BasicReturnand other events for now
Tips
RoutingKeyisQueueName/ExchangeNameby default- Do not use same connection for consumers and producers because of tcp backpressure
- Use
BatchProduceinstead ofProducewith loop
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 3.0.0)
- Microsoft.Extensions.Options (>= 3.0.0)
- RabbitMQ.Client (>= 6.0.0-pre6)
- System.Text.Json (>= 4.6.0)
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 |
|---|---|---|
| 3.1.8 | 1,672 | 10/12/2019 |
| 3.1.7 | 1,459 | 10/12/2019 |
| 3.1.6 | 1,453 | 10/12/2019 |
| 3.1.5 | 1,529 | 9/25/2019 |
| 3.1.4 | 514 | 9/3/2019 |
| 3.1.3 | 514 | 9/1/2019 |
| 3.1.2 | 506 | 8/31/2019 |
| 3.1.1 | 521 | 8/31/2019 |
| 3.1.0 | 493 | 8/30/2019 |
| 3.0.0 | 1,462 | 7/24/2019 |
| 3.0.0-preview3.0.5 | 525 | 4/1/2019 |
| 3.0.0-preview3.0.4 | 487 | 3/28/2019 |
Loading failed