RabbitMQ.Connect.Helper 1.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package RabbitMQ.Connect.Helper --version 1.0.7
                    
NuGet\Install-Package RabbitMQ.Connect.Helper -Version 1.0.7
                    
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="RabbitMQ.Connect.Helper" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RabbitMQ.Connect.Helper" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="RabbitMQ.Connect.Helper" />
                    
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 RabbitMQ.Connect.Helper --version 1.0.7
                    
#r "nuget: RabbitMQ.Connect.Helper, 1.0.7"
                    
#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 RabbitMQ.Connect.Helper@1.0.7
                    
#: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=RabbitMQ.Connect.Helper&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=RabbitMQ.Connect.Helper&version=1.0.7
                    
Install as a Cake Tool

RabbitMQ Connection Helper

A .NET NuGet package to simplify working with RabbitMQ for producing and consuming messages. This package provides an easy-to-use interface for managing connections, exchanges, queues, and publishing/consuming messages in a RabbitMQ environment.

Features

  • Asynchronous support for RabbitMQ connections.
  • Simplified message publishing and consumption.
  • Built-in support for durable queues and exchanges.
  • Helper methods for creating producers and consumers.

Installation

Install the package via NuGet Package Manager:

Install-Package RabbitMQ.Connect.Helper

Or via the .NET CLI:

dotnet add package RabbitMQ.Connect.Helper

Usage

1. Add Appsetings.json

    "RabbitMqConfig": {
      "HostName": "localhost",
      "Port": 5672,
      "UserName": "guest",
      "Password": "guest"
    }

2. Setup RabbitMQ Connection -- add this to your program/startup file

        services.Configure<RabbitMqConfig>(cxt.Configuration.GetSection("RabbitMqConfig"));
        services.AddSingleton<IRabbitMqConsumer, RabbitMqConsumer>();
        services.AddSingleton<IRabbitMqProducer, RabbitMqProducer>();

3. Publish Messages



    private readonly IRabbitMqConsumer _rabbitMqConsumer;
    private readonly IRabbitMqProducer _rabbitMqProducer;

    public YourClass(IRabbitMqConsumer rabbitMqConsumer, IRabbitMqProducer rabbitMqProducer)
    {
        _rabbitMqConsumer = rabbitMqConsumer;
        _rabbitMqProducer = rabbitMqProducer;
    }


    public ProducerExample(){
    var queueName = "example-queue";
    var message = "Hello, RabbitMQ!";
         await  _rabbitMqProducer.PublishMessageToQueueAsync(queueName, message); 
    }

4. Consume Messages

          var queueName = "example-queue";

           await consumer.ConsumeAsync(queueName, async (message) =>
            {
                Console.WriteLine($"Received message: {message}");

            });

Configuration

  • Exchange Type: Supports direct, topic, fanout, and headers.
  • Durability: Ensures exchanges and queues are durable for reliable messaging.
  • Auto Acknowledge: Messages are acknowledged automatically or manually.

Contributing

Contributions are welcome! If you find a bug or want to add a feature, feel free to open an issue or submit a pull request.

License

This package is licensed under the MIT License. See the LICENSE file for details.

Contact

For any issues or questions, feel free to reach out to the maintainer.

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.1.0 591 5/6/2025
1.0.7 180 4/29/2025
1.0.6 179 4/29/2025
1.0.5 555 2/17/2025
1.0.4 109 1/20/2025
1.0.3 107 1/20/2025
1.0.2 136 12/26/2024
1.0.1 104 12/26/2024
1.0.0 118 12/24/2024