Class CachingConnectionFactory
- Namespace
- Steeltoe.Messaging.RabbitMQ.Connection
- Assembly
- Steeltoe.Messaging.RabbitMQ.dll
public class CachingConnectionFactory : AbstractConnectionFactory, IConnectionFactory, IDisposable, IServiceNameAware, IShutdownListener
- Inheritance
-
CachingConnectionFactory
- Implements
- Inherited Members
Constructors
CachingConnectionFactory(ILoggerFactory)
public CachingConnectionFactory(ILoggerFactory loggerFactory = null)
Parameters
loggerFactory
ILoggerFactory
CachingConnectionFactory(IOptionsMonitor<RabbitOptions>, ILoggerFactory)
[ActivatorUtilitiesConstructor]
public CachingConnectionFactory(IOptionsMonitor<RabbitOptions> optionsMonitor, ILoggerFactory loggerFactory = null)
Parameters
optionsMonitor
IOptionsMonitor<RabbitOptions>loggerFactory
ILoggerFactory
CachingConnectionFactory(IConnectionFactory, ILoggerFactory)
protected CachingConnectionFactory(IConnectionFactory rabbitConnectionFactory, ILoggerFactory loggerFactory = null)
Parameters
rabbitConnectionFactory
IConnectionFactoryloggerFactory
ILoggerFactory
CachingConnectionFactory(IConnectionFactory, bool, CachingMode, ILoggerFactory)
protected CachingConnectionFactory(IConnectionFactory rabbitConnectionFactory, bool isPublisherFactory, CachingConnectionFactory.CachingMode cachingMode = CachingMode.CHANNEL, ILoggerFactory loggerFactory = null)
Parameters
rabbitConnectionFactory
IConnectionFactoryisPublisherFactory
boolcachingMode
CachingConnectionFactory.CachingModeloggerFactory
ILoggerFactory
CachingConnectionFactory(int, ILoggerFactory)
public CachingConnectionFactory(int port, ILoggerFactory loggerFactory = null)
Parameters
port
intloggerFactory
ILoggerFactory
CachingConnectionFactory(string, ILoggerFactory)
public CachingConnectionFactory(string hostname, ILoggerFactory loggerFactory = null)
Parameters
hostname
stringloggerFactory
ILoggerFactory
CachingConnectionFactory(string, int, ILoggerFactory)
public CachingConnectionFactory(string hostNameArg, int port, ILoggerFactory loggerFactory = null)
Parameters
hostNameArg
stringport
intloggerFactory
ILoggerFactory
CachingConnectionFactory(string, int, IConnectionFactory, ILoggerFactory)
public CachingConnectionFactory(string hostNameArg, int port, IConnectionFactory connectionFactory, ILoggerFactory loggerFactory = null)
Parameters
hostNameArg
stringport
intconnectionFactory
IConnectionFactoryloggerFactory
ILoggerFactory
CachingConnectionFactory(Uri, ILoggerFactory)
public CachingConnectionFactory(Uri uri, ILoggerFactory loggerFactory = null)
Parameters
uri
UriloggerFactory
ILoggerFactory
CachingConnectionFactory(Uri, CachingMode, ILoggerFactory)
public CachingConnectionFactory(Uri uri, CachingConnectionFactory.CachingMode cachingMode = CachingMode.CHANNEL, ILoggerFactory loggerFactory = null)
Parameters
uri
UricachingMode
CachingConnectionFactory.CachingModeloggerFactory
ILoggerFactory
Fields
DEFAULT_SERVICE_NAME
public const string DEFAULT_SERVICE_NAME = "ccFactory"
Field Value
Properties
CacheMode
public CachingConnectionFactory.CachingMode CacheMode { get; set; }
Property Value
ChannelCacheSize
public int ChannelCacheSize { get; set; }
Property Value
ChannelCheckoutTimeout
public int ChannelCheckoutTimeout { get; set; }
Property Value
CloseExceptionLogger
public IConditionalExceptionLogger CloseExceptionLogger { get; set; }
Property Value
ConnectionCacheSize
public int ConnectionCacheSize { get; set; }
Property Value
ConnectionLimit
public int ConnectionLimit { get; set; }
Property Value
IsPublisherConfirms
Gets a value indicating whether if publisher confirms are enabled
public override bool IsPublisherConfirms { get; }
Property Value
IsPublisherReturns
Gets a value indicating whether if publisher returns are enabled
public override bool IsPublisherReturns { get; set; }
Property Value
IsSimplePublisherConfirms
Gets a value indicating whether if simple publisher confirms are enabled
public override bool IsSimplePublisherConfirms { get; }
Property Value
Options
protected RabbitOptions Options { get; }
Property Value
PublisherCachingConnectionFactory
public CachingConnectionFactory PublisherCachingConnectionFactory { get; set; }
Property Value
PublisherCallbackChannelFactory
public IPublisherCallbackChannelFactory PublisherCallbackChannelFactory { get; set; }
Property Value
PublisherConfirmType
public CachingConnectionFactory.ConfirmType PublisherConfirmType { get; set; }
Property Value
Methods
AddConnectionListener(IConnectionListener)
Add a connection listener to this factory
public override void AddConnectionListener(IConnectionListener connectionListener)
Parameters
connectionListener
IConnectionListenerthe listener to add
ChannelShutdownCompleted(object, ShutdownEventArgs)
public void ChannelShutdownCompleted(object sender, ShutdownEventArgs args)
Parameters
sender
objectargs
ShutdownEventArgs
CloseAndClear(LinkedList<IChannelProxy>)
protected void CloseAndClear(LinkedList<IChannelProxy> theChannels)
Parameters
theChannels
LinkedList<IChannelProxy>
CloseChannels(ICollection<IChannelProxy>)
protected void CloseChannels(ICollection<IChannelProxy> theChannels)
Parameters
theChannels
ICollection<IChannelProxy>
CreateConnection()
Create a connection
public override IConnection CreateConnection()
Returns
- IConnection
the connection if successful
Destroy()
Close underlying shared connection. The factory is still able to create new connections after this call
public override void Destroy()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
GetCacheProperties()
public IDictionary<string, object> GetCacheProperties()
Returns
Reset(LinkedList<IChannelProxy>, LinkedList<IChannelProxy>, Dictionary<IModel, IChannelProxy>)
protected void Reset(LinkedList<IChannelProxy> channels, LinkedList<IChannelProxy> txChannels, Dictionary<IModel, IChannelProxy> channelsAwaitingAcks)
Parameters
channels
LinkedList<IChannelProxy>txChannels
LinkedList<IChannelProxy>channelsAwaitingAcks
Dictionary<IModel, IChannelProxy>
ResetConnection()
public void ResetConnection()
SetConnectionListeners(List<IConnectionListener>)
public override void SetConnectionListeners(List<IConnectionListener> listeners)
Parameters
listeners
List<IConnectionListener>