C# - Set a friendly / readable ConnectionName for RabbitMQ connection

C# - Set a friendly / readable ConnectionName for RabbitMQ connection

I recently looked into this. I did a lot of googling before finding the simplest solution ever. using your ConnectionFactory(or IConnectionFactory) you invoke the method CreateConnection in order to create a connection. This method takes a clientProvidedName, this is the method and parameter you want to use. Reading comments around the internet this feature seems to have been added in RabbitMQ 3.6+. An example can be seen below:

ConnectionFactory factory = new ConnectionFactory();
factory.ClientProvidedName = "SomeConnectionName"

The clientProvidedName is not unique and should not be used as a key or identification of any sort. It is simply a human friendly name for a connection. There is more information in the RabbitMQ documentation of ConnectionFactory.