public static IConnection GetConnection(RabbitMQOptions options) { //var sslOptions = new SslOption(options.Endpoint.Hostname, //options.Endpoint.SslCertPath, //options.Endpoint.SslEnabled); var factory = new ConnectionFactory { HostName = options.Endpoint.Hostname, Port = options.Endpoint.Port, //Ssl = sslOptions, UserName = options.Credentials.Username, Password = options.Credentials.Password, VirtualHost = options.VirtualHost, RequestedChannelMax = options.Settings.RequestedChannelMax, RequestedFrameMax = options.Settings.RequestedFrameMax, AutomaticRecoveryEnabled = options.Settings.AutomaticRecoveryEnabled, TopologyRecoveryEnabled = options.Settings.TopologyRecoveryEnabled, RequestedConnectionTimeout = options.Settings.RequestedConnectionTimeout, RequestedHeartbeat = options.Settings.RequestedHeartbeat, DispatchConsumersAsync = true }; return(factory.CreateConnection()); }
//private CountdownTimer retryTimer; public ConnectionsManager( IOptions <RabbitMQOptions> options) { this.options = options.Value; //this.logger = logger; //retryTimer = new CountdownTimer(); }