GoblinRabbitMQ 1.0.0-beta
dotnet add package GoblinRabbitMQ --version 1.0.0-beta
NuGet\Install-Package GoblinRabbitMQ -Version 1.0.0-beta
<PackageReference Include="GoblinRabbitMQ" Version="1.0.0-beta" />
<PackageVersion Include="GoblinRabbitMQ" Version="1.0.0-beta" />
<PackageReference Include="GoblinRabbitMQ" />
paket add GoblinRabbitMQ --version 1.0.0-beta
#r "nuget: GoblinRabbitMQ, 1.0.0-beta"
#:package GoblinRabbitMQ@1.0.0-beta
#addin nuget:?package=GoblinRabbitMQ&version=1.0.0-beta&prerelease
#tool nuget:?package=GoblinRabbitMQ&version=1.0.0-beta&prerelease
GoblinRabbitMQ
GoblinRabbitMQ is a RabbitMQ integration library for .NET 8 applications. It provides a fluent API for configuring RabbitMQ connections, channels, and queues, and allows for strongly-typed message publishing and consuming.
Features
- Fluent API for configuring RabbitMQ connections, channels, and queues
- Strongly-typed message publishing and consuming
Installation
You can install the GoblinRabbitMQ package via NuGet:
dotnet add package GoblinRabbitMQ --version 1.0.0-beta
Usage
Configuration
First, configure the RabbitMQ connection, channel, and queue using the RabbitMqBuilder.
You can have strongTyped queues:
public class MyMessage { public string Content { get; set; } }
await services.CreateRabbitMqbuilder()
.ConfigureConnection(factory =>
{
factory.HostName = "localhost";
factory.Port = 5672;
factory.UserName = "guest";
factory.Password = "guest";
})
.AddQueue<MyMessage>(QueueOneName, options =>
{
options.Durable = false;
options.Exclusive = false;
options.AutoDelete = false;
});
Publishing Messages
Inject the RabbitMqQueue<T> into your service and use it to publish messages:
public class MyService (RabbitMqQueue<MyMessage> queue) {
public Task PublishMessage()
{
await queue.PublishMessage(forecast);
}
}
Consuming Messages
Use the ConsumeMessages method to consume messages from the queue:
public class MyService (RabbitMqQueue<MyMessage> queue) {
public Task ConsumeMessage()
{
await queue.ConsumeMessages(message =>
{
Console.WriteLine($"Received message: {JsonSerializer.Serialize(message)}");
_weatherDataService.UpdateWeatherData(message);
});
}
}
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Repository
| 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
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Options (>= 9.0.2)
- RabbitMQ.Client (>= 7.1.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 |
|---|---|---|
| 1.0.0-beta | 128 | 2/23/2025 |
Initial beta release of GoblinRabbitMQ.