Skip to content

Commit 05ab8a3

Browse files
committed
Add CreateConnection overload to IConnectionFactory
The method was implemented in ConnectionFactory, so the only thing done was to pull it up to the interface. This fixes #324
1 parent 51726fb commit 05ab8a3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

projects/client/RabbitMQ.Client/src/client/api/IConnectionFactory.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
using System;
4242
using System.Collections.Generic;
4343
using System.Threading.Tasks;
44+
using RabbitMQ.Client.Exceptions;
4445

4546
namespace RabbitMQ.Client
4647
{
@@ -135,6 +136,21 @@ public interface IConnectionFactory
135136
/// <returns></returns>
136137
IConnection CreateConnection(IList<string> hostnames, String clientProvidedName);
137138

139+
/// <summary>
140+
/// Create a connection using a list of endpoints. By default each endpoint will be tried
141+
/// in a random order until a successful connection is found or the list is exhausted.
142+
/// The selection behaviour can be overriden by configuring the EndpointResolverFactory.
143+
/// </summary>
144+
/// <param name="endpoints">
145+
/// List of endpoints to use for the initial
146+
/// connection and recovery.
147+
/// </param>
148+
/// <returns>Open connection</returns>
149+
/// <exception cref="BrokerUnreachableException">
150+
/// When no hostname was reachable.
151+
/// </exception>
152+
IConnection CreateConnection(IList<AmqpTcpEndpoint> endpoints);
153+
138154
/// <summary>
139155
/// Advanced option.
140156
///

0 commit comments

Comments
 (0)