FastCSharp.RabbitSubscriber
0.0.0-alpha
See the version list below for details.
dotnet add package FastCSharp.RabbitSubscriber --version 0.0.0-alpha
NuGet\Install-Package FastCSharp.RabbitSubscriber -Version 0.0.0-alpha
<PackageReference Include="FastCSharp.RabbitSubscriber" Version="0.0.0-alpha" />
paket add FastCSharp.RabbitSubscriber --version 0.0.0-alpha
#r "nuget: FastCSharp.RabbitSubscriber, 0.0.0-alpha"
// Install FastCSharp.RabbitSubscriber as a Cake Addin #addin nuget:?package=FastCSharp.RabbitSubscriber&version=0.0.0-alpha&prerelease // Install FastCSharp.RabbitSubscriber as a Cake Tool #tool nuget:?package=FastCSharp.RabbitSubscriber&version=0.0.0-alpha&prerelease
FastCSharp's RabbitMQ Subscriber
RabbitSubscriber provides a simple approach for subscribing to a RabbitMQ queue.
It is a wrapper around the RabbitMQ.Client library.
Usage
var exchange = new RabbitDirectExchangeFactory(configuration, loggerFactory);
using var subscriber = exchange.NewSubscriber<string>("SUBSCRIBE.SDK.DIRECT", "TASK_QUEUE");
subscriber.Subscribe(async (message, cancellationToken) =>
{
await Task.Delay(1000, cancellationToken);
Console.WriteLine(message);
});
appsettings.json config file sample
{
"RabbitSubscriberConfig" :
{
"HostName" : "localhost",
"Port" : 5672,
"UserName" : "guest",
"Password" : "guest",
"HeartbeatTimeout" : "00:00:20",
"Queues" :
{
"QUEUE_TOKEN" :
{
"Name":"queue.name",
"PrefecthCount":1,
"PrefecthSize":0
},
"TASK_QUEUE" :
{
"Name":"test.direct.q",
"PrefecthCount":1,
"PrefecthSize":0
}
}
}
}
Adding a Circuit Breaker
The subscriber can be stopped by calling:
subscriber.UnSubscribe();
This is a useful callback when a circuit breaker is triggered and the OnOpen
or OnBreak
event is fired.
The subscriber can be reset by calling:
subscriber.Reset();
This is a useful callback when a circuit breaker is triggered and the OnReset
event is fired.
Check the FastCSharp.CircuitBreaker package for more information on circuit breakers.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- FastCSharp.Common (>= 0.0.0-alpha)
- FastCSharp.Subscriber (>= 0.0.0-alpha)
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 7.0.0)
- Microsoft.Extensions.Logging (>= 7.0.0)
- RabbitMQ.Client (>= 6.4.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 | |
---|---|---|---|
2.4.0 | 226 | 9/8/2024 | |
2.3.0 | 270 | 5/7/2024 | |
2.2.0 | 403 | 1/5/2024 | |
2.1.0 | 154 | 12/19/2023 | |
2.0.0 | 132 | 12/17/2023 | |
1.0.0 | 198 | 10/20/2023 | |
0.3.0-alpha | 123 | 9/24/2023 | |
0.2.1-alpha | 113 | 9/22/2023 | |
0.2.0-alpha | 123 | 9/22/2023 | |
0.0.1-alpha | 116 | 9/18/2023 | |
0.0.0-alpha | 128 | 4/9/2023 |