RabbitMqModule 1.0.8

RabbitMqModule

RabbitMqModule, RabbitMQ ile mesajlaşma işlemlerini kolayca entegre edebilmeniz için yazılmış bir servis modülüdür. Modül, mesaj göndermek için kullanılan temel işlevselliği kapsar ve başka uygulamalarda kolayca yeniden kullanılabilir.

Bu modül, RabbitMQ servisinin bağlantı yönetimini ve mesaj gönderme işlemini bir arada sunar. SendMessage metodu ile belirli bir exchange, routing key ve message ile mesaj gönderilmesini sağlar.

Projeye Ekleme

Windows : %appdata%\NuGet\NuGet.Config Lİnux Veya Mac : ~/.nuget/NuGet/NuGet.Config

  ...
<packageSources>
    ...
    <add key="localnuget.roboliza.com" value="http://172.16.33.42:5011/v3/index.json" protocolVersion="3" allowInsecureConnections="true" />
    <add key="nuget.roboliza.com" value="https://nuget.roboliza.com/v3/index.json" protocolVersion="3" allowInsecureConnections="true" /> 
</packageSources>

Dockerfile Dosyasına Ekleme

RUN dotnet nuget add source http://172.16.33.42:5011/v3/index.json
RUN dotnet nuget add source https://nuget.roboliza.com/v3/index.json

RabbitMq Modülünü Dahil Etme

Program.cs

public void ConfigureServices(IServiceCollection services)
{
    RabbitMqConfig rabbitMqConfig = new()
    {
        HostName = "HostName",
        UserName = "UserName",
        Password = "Password",
        ServiceName = "serviceName",
        ProvidedName = "providedName"
    };
    services.AddRabbitMqModule(rabbitMqConfig); 
}

Kullanım

public class MessageSenderService
{
    // Dependency Injection ile bu delegate, RabbitMQ servisinin SendMessage metodunu çağırabilmemizi sağlar
    private readonly Func<string, string, object, Action<string, string, object>> _sendMessageFunc;

    public MessageSenderService(Func<string, string, object, Action<string, string, object>> sendMessageFunc)
    {
        _sendMessageFunc = sendMessageFunc;
    }

    public void SendMessage(string exchange, string routingKey, object message)
    {
        var sendMessage = _sendMessageFunc(exchange, routingKey, message);
        sendMessage(exchange, routingKey, message); // Mesajı gönder
    }
}

No packages depend on RabbitMqModule.

Version Downloads Last updated
1.0.13 22 06/20/2025
1.0.12 145 06/20/2025
1.0.11 75 03/06/2025
1.0.10 10 03/06/2025
1.0.9 10 03/06/2025
1.0.8 11 03/06/2025
1.0.6 13 03/06/2025
1.0.5 216 01/13/2025
1.0.4 11 01/13/2025
1.0.3 12 01/13/2025