Aj.RabbitMQ.Core 1.0.14

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

Aj.RabbitMQ.Core

🚀 Biblioteca .NET para abstração de mensageria no RabbitMQ, totalmente extensível, orientada a microsserviços e multi-tenant.


✨ Recursos

✅ Conexão centralizada (singleton)
✅ Configuração via IConfiguration e DataAnnotations
✅ Declaração de exchanges, filas, bindings padronizados
✅ Suporte a prefetch (QoS)
✅ Envelope de mensagens estruturado (MessageEnvelope)
✅ Retry e DLQ integrado (padrão de robustez)
✅ Helpers para exchanges direct, topic, fanout
✅ Extensões para injeção no IServiceCollection


📦 Instalação

no seu projeto:

dotnet add package Aj.RabbitMQ.Core

⚙️ Configuração

adicione ao seu appsettings.json:

"RabbitMQSettings": {
  "HostName": "localhost",
  "UserName": "admin",
  "Password": "123456",
  "VirtualHost": "/",
  "Port": 5672,
  "TenantId": "tenant1"
}

OBS: A Propriedade "TenantId" so deve ser informada caso a fila precise ser exclusiva do Client.

e registre no Program.cs:

builder.Services.AddRabbitMQServices(builder.Configuration);

🚀 Uso Básico

var connectionFactory = serviceProvider.GetRequiredService<RabbitMQConnectionFactory>();
var channel = await connectionFactory.GetChannelAsync();

🟦 Retry + DLQ

por padrão, sugerimos:

  • fila normal
  • fila .retry com x-message-ttl
  • fila .dlq para mensagens definitivas
  • exchanges:
    • direct.order
    • direct.retry
    • direct.dlq

📚 Exemplos avançados

declarar exchange

await _channel.ExchangeDeclareAsync(
    exchange: "direct.order",
    type: "direct",
    durable: true,
    autoDelete: false
);

declarar fila com TTL + DLQ

await _channel.QueueDeclareAsync(
    queue: "order.billing.retry",
    durable: true,
    exclusive: false,
    autoDelete: false,
    arguments: new Dictionary<string, object>
    {
        { "x-message-ttl", 300000 },
        { "x-dead-letter-exchange", "direct.order" },
        { "x-dead-letter-routing-key", "order.created" }
    }
);

✅ Checklist de Qualidade

  • Multi-tenant
  • Extensível
  • Segue princípios SOLID
  • Fácil integração com MediatR e Polly
  • Suporte ao plugin management do RabbitMQ

👨‍💻 Contribuições

Pull Requests são muito bem-vindos!
Basta abrir uma issue ou PR neste repositório.


📄 Licença

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Aj.RabbitMQ.Core:

Package Downloads
Aj.Platform.Core

Biblioteca de Uso Geral para integrações com as API OmsAj

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.21 0 10/1/2025
1.0.20 168 9/25/2025
1.0.19 120 9/25/2025
1.0.18 121 9/25/2025
1.0.17 222 9/24/2025
1.0.16 166 9/9/2025
1.0.15 118 8/20/2025
1.0.14 414 8/11/2025
1.0.13 229 8/6/2025
1.0.12 210 8/6/2025
1.0.11 206 8/5/2025
1.0.10 215 8/5/2025
1.0.9 60 8/1/2025
1.0.8 466 7/24/2025
1.0.7 139 7/15/2025
1.0.6 243 7/15/2025
1.0.5 162 7/15/2025
1.0.1 115 6/27/2025

Versão inicial do Aj.RabbitMQ.Core com suporte a exchanges, filas, retry e dead-letter queues.