File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -28,23 +28,28 @@ public class ChannelFactory : IChannelFactory
2828 private bool _processingRequests ;
2929
3030 public ChannelFactory ( IConnectionFactory connectionFactory , RawRabbitConfiguration config , ChannelFactoryConfiguration channelConfig )
31+ {
32+ ConnectToBroker ( ) ;
33+ _connectionFactory = connectionFactory ;
34+ _config = config ;
35+ _channelConfig = channelConfig ;
36+ _requestQueue = new ConcurrentQueue < TaskCompletionSource < IModel > > ( ) ;
37+ _channels = new LinkedList < IModel > ( ) ;
38+
39+ Initialize ( ) ;
40+ }
41+
42+ protected virtual void ConnectToBroker ( )
3143 {
3244 try
3345 {
34- _connection = connectionFactory . CreateConnection ( config . Hostnames ) ;
46+ _connection = _connectionFactory . CreateConnection ( _config . Hostnames ) ;
3547 }
3648 catch ( BrokerUnreachableException e )
3749 {
3850 _logger . LogError ( "Unable to connect to broker" , e ) ;
3951 throw e . InnerException ;
4052 }
41- _connectionFactory = connectionFactory ;
42- _config = config ;
43- _channelConfig = channelConfig ;
44- _requestQueue = new ConcurrentQueue < TaskCompletionSource < IModel > > ( ) ;
45- _channels = new LinkedList < IModel > ( ) ;
46-
47- Initialize ( ) ;
4853 }
4954
5055 internal virtual void Initialize ( )
You can’t perform that action at this time.
0 commit comments