-
Notifications
You must be signed in to change notification settings - Fork 171
Description
Problem
EasyNetQ is a popular package that provides high level abstrations for working with RabbitMQ. The way it wants to be configured is via its own configuration class that expects to be provided individual connection string elements of RabbitMQ (host, port, credentials, SSL settings, etc). Example:
builder.Services.RegisterEasyNetQ(svc =>
{
return new ConnectionConfiguration
{
Hosts = new List<HostConfiguration> { host },
UserName = username,
Password = password
};
});Currently, connectors do not provide easy way to access individual elements needed to configure it. The closest is the ability to inject RabbitMQOptions that only exposes string ConnectionString property, requiring one to parse it manually.
Proposed solution
Register both IConnection and IConnectionFactory from RabbitMQ. If IConnectionFactory is available, it can be cast back to ConnectionFactory and all the elements copied over. Alternatively (or in addition), expose make RabbitMQConnectionStringBuilder public and expose individual well-known elements of connection string as strongly type properties.