GoblinRabbitMQ 1.0.0-beta

This is a prerelease version of GoblinRabbitMQ.
dotnet add package GoblinRabbitMQ --version 1.0.0-beta
                    
NuGet\Install-Package GoblinRabbitMQ -Version 1.0.0-beta
                    
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="GoblinRabbitMQ" Version="1.0.0-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GoblinRabbitMQ" Version="1.0.0-beta" />
                    
Directory.Packages.props
<PackageReference Include="GoblinRabbitMQ" />
                    
Project file
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 GoblinRabbitMQ --version 1.0.0-beta
                    
#r "nuget: GoblinRabbitMQ, 1.0.0-beta"
                    
#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 GoblinRabbitMQ@1.0.0-beta
                    
#: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=GoblinRabbitMQ&version=1.0.0-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=GoblinRabbitMQ&version=1.0.0-beta&prerelease
                    
Install as a Cake Tool

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

GitHub Repository

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.