Skip to content

Using steeltoe connectors with EasyNetQ is awkward.  #1309

@macsux

Description

@macsux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions