Table of Contents

Interface IConnectionFactory

Namespace
RabbitMQ.Client
Assembly
RabbitMQ.Client.dll
public interface IConnectionFactory

Properties

ClientProperties

Dictionary of client properties to be sent to the server.

IDictionary<string, object> ClientProperties { get; set; }

Property Value

IDictionary<string, object>

ClientProvidedName

Default client provided name to be used for connections.

string ClientProvidedName { get; set; }

Property Value

string

ContinuationTimeout

Amount of time protocol operations (e.g.

queue.declare
) are allowed to take before timing out.
TimeSpan ContinuationTimeout { get; set; }

Property Value

TimeSpan

CredentialsProvider

Default CredentialsProvider implementation. If set, this overrides UserName / Password

ICredentialsProvider CredentialsProvider { get; set; }

Property Value

ICredentialsProvider

CredentialsRefresher

ICredentialsRefresher CredentialsRefresher { get; set; }

Property Value

ICredentialsRefresher

HandshakeContinuationTimeout

Amount of time protocol handshake operations are allowed to take before timing out.

TimeSpan HandshakeContinuationTimeout { get; set; }

Property Value

TimeSpan

Password

Password to use when authenticating to the server.

string Password { get; set; }

Property Value

string

RequestedChannelMax

Maximum channel number to ask for.

ushort RequestedChannelMax { get; set; }

Property Value

ushort

RequestedFrameMax

Frame-max parameter to ask for (in bytes).

uint RequestedFrameMax { get; set; }

Property Value

uint

RequestedHeartbeat

Heartbeat setting to request.

TimeSpan RequestedHeartbeat { get; set; }

Property Value

TimeSpan

Uri

Sets or gets the AMQP Uri to be used for connections.

Uri Uri { get; set; }

Property Value

Uri

UseBackgroundThreadsForIO

When set to true, background threads will be used for I/O and heartbeats.

bool UseBackgroundThreadsForIO { get; set; }

Property Value

bool

UserName

Username to use when authenticating to the server.

string UserName { get; set; }

Property Value

string

VirtualHost

Virtual host to access during this connection.

string VirtualHost { get; set; }

Property Value

string

Methods

AuthMechanismFactory(IList<string>)

Given a list of mechanism names supported by the server, select a preferred mechanism, or null if we have none in common.

IAuthMechanismFactory AuthMechanismFactory(IList<string> mechanismNames)

Parameters

mechanismNames IList<string>

Returns

IAuthMechanismFactory

CreateConnection()

Create a connection to the specified endpoint.

IConnection CreateConnection()

Returns

IConnection

CreateConnection(IList<AmqpTcpEndpoint>)

Create a connection using a list of endpoints. The selection behaviour can be overridden by configuring the EndpointResolverFactory.

IConnection CreateConnection(IList<AmqpTcpEndpoint> endpoints)

Parameters

endpoints IList<AmqpTcpEndpoint>

List of endpoints to use for the initial connection and recovery.

Returns

IConnection

Open connection

Exceptions

BrokerUnreachableException

When no hostname was reachable.

CreateConnection(IList<AmqpTcpEndpoint>, string)

Create a connection using a list of endpoints. The selection behaviour can be overridden by configuring the EndpointResolverFactory.

IConnection CreateConnection(IList<AmqpTcpEndpoint> endpoints, string clientProvidedName)

Parameters

endpoints IList<AmqpTcpEndpoint>

List of endpoints to use for the initial connection and recovery.

clientProvidedName string

Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable.

Returns

IConnection

Open connection

Exceptions

BrokerUnreachableException

When no hostname was reachable.

CreateConnection(IList<string>)

Connects to the first reachable hostname from the list.

IConnection CreateConnection(IList<string> hostnames)

Parameters

hostnames IList<string>

List of host names to use

Returns

IConnection

Open connection

CreateConnection(IList<string>, string)

Connects to the first reachable hostname from the list.

IConnection CreateConnection(IList<string> hostnames, string clientProvidedName)

Parameters

hostnames IList<string>

List of host names to use

clientProvidedName string

Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable.

Returns

IConnection

Open connection

CreateConnection(string)

Create a connection to the specified endpoint.

IConnection CreateConnection(string clientProvidedName)

Parameters

clientProvidedName string

Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable.

Returns

IConnection

Open connection