antonyvorontsov / RabbitMQ.Client.Core.DependencyInjection

.Net Core library-wrapper of RabbitMQ.Client for Dependency Injection.
MIT License
111 stars 36 forks source link

ClientProvidedName from RabbitMqClientOptions not used when connecting using SSL #70

Open NikoGJ opened 3 years ago

NikoGJ commented 3 years ago

Hi guys,

I just found out that the ClientProvidedName property of the RabbitMqClientOptions class is not used when connecting to the Rabbit instance using SSL. So in the Management UI, the connection name stays with "undefined" (not very pretty :))

By having a quick look at the code, we can see that the ClientProvidedName is correctly used in "RabbitMqConnectionFactory.cs" with the usage of a dedicated method "CreateNamedConnection" for that purpose. (cf. line 48) But when connecting through SSL, as stated in the docs, the configuration is not quite the same and we have to use the TcpEndPoints property. Unfortunately, this bypasses the CreateNamedConnection method and goes instead through a different execution path (CreateConnectionWithTcpEndpoints) where the ClientProvidedName property is not handled anymore.

Cheers, Nico