Escendit.AspNetCore.Builder.RabbitMQ.AmqpProtocol is a NuGet package that provides the ability to register
StreamSystem.
To install Escendit.AspNetCore.Builder.RabbitMQ.AmqpProtocol, run the following command in the Package Manager Console:
Install-Package Escendit.AspNetCore.Builder.RabbitMQ.AmqpProtocolThere are several ways to register contracts that can be used in an application:
WebApplication
.CreateBuilder()
.AddRabbitMqConnectionFactory("name", ...)var connectionFactory = serviceProvider.GetRequiredKeyedService<IConnectionFactory>("name");var connectionFactory = serviceProvider.GetRequiredServiceByKey<object?, IConnectionFactory>("name");WebApplication
.CreateBuilder()
.AddRabbitMqConnectionFactoryFromOption("name", "existing_name")var connectionFactory = serviceProvider.GetRequiredKeyedService<IConnectionFactory>("name");var connectionFactory = serviceProvider.GetRequiredServiceByKey<object?, IConnectionFactory>("name");Register and use IConnection with the newly named ConnectionOptions and IConnectionFactory registration.
WebApplication
.CreateBuilder()
.AddRabbitMqConnection("name", ...)var connection = serviceProvider.GetRequiredKeyedService<IConnection>("name");var connection = serviceProvider.GetRequiredServiceByKey<object?, IConnection>("name");WebApplication
.CreateBuilder()
.AddRabbitMqConnectionFromFactory("name", "existing_name")var connection = serviceProvider.GetRequiredKeyedService<IConnection>("name");var connection = serviceProvider.GetRequiredServiceByKey<object?, IConnection>("name");If you'd like to contribute to rabbitmq-dotnet-extensions, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.