Skip to content

Commit

Permalink
Make ConnectionConfiguration public
Browse files Browse the repository at this point in the history
  • Loading branch information
twenzel committed Oct 21, 2024
1 parent 2686b70 commit 890be79
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -22,8 +22,4 @@
<PackageReference Include="RabbitMQ.Client" Version="7.0.0-rc.11" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Configuration\ConnectionConfiguration.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
using System.Linq;
using System.Text;

class ConnectionConfiguration
/// <summary>
/// Configuration container for the RabbitMQ connection.
/// </summary>
public class ConnectionConfiguration
{
const bool defaultUseTls = false;
const int defaultPort = 5672;
Expand All @@ -15,16 +18,34 @@ class ConnectionConfiguration
const string defaultUserName = "guest";
const string defaultPassword = "guest";

/// <summary>
/// Gets the broker host.
/// </summary>
public string Host { get; }

/// <summary>
/// Gets the port the broker uses.
/// </summary>
public int Port { get; }

/// <summary>
/// Gets the virtual host.
/// </summary>
public string VirtualHost { get; }

/// <summary>
/// Gets the user name used for the connection.
/// </summary>
public string UserName { get; }

/// <summary>
/// Gets the password used for the connection.
/// </summary>
public string Password { get; }

/// <summary>
/// Gets whether TLS should be used.
/// </summary>
public bool UseTls { get; }

ConnectionConfiguration(
Expand All @@ -43,6 +64,11 @@ class ConnectionConfiguration
UseTls = useTls;
}

/// <summary>
/// Parses the connection string and returns the connection information.
/// </summary>
/// <param name="connectionString">The connection string to be parsed.</param>
/// <returns></returns>
public static ConnectionConfiguration Create(string connectionString)
{
Dictionary<string, string> dictionary;
Expand Down

0 comments on commit 890be79

Please sign in to comment.