Exemplo n.º 1
0
 internal Connection(RabbitMQ.Client.IConnection connection,
                     IEnumerable <ConsumerBase> consumers,
                     IOutboundChannel outboundChannel,
                     EnvironmentConfiguration configuration)
 {
     _connection      = connection;
     _consumers       = consumers;
     _outboundChannel = outboundChannel;
     Configuration    = configuration;
 }
Exemplo n.º 2
0
 public QueuePushHandle()
 {
     sqlDb   = new SqlDb(QT.Entities.Server.ConnectionStringCrawler);
     factory = new RabbitMQ.Client.ConnectionFactory()
     {
         HostName = QT.Entities.Server.RabbitMQ_Host,
         Port     = QT.Entities.Server.RabbitMQ_Port,
         UserName = QT.Entities.Server.RabbitMQ_User,
         Password = QT.Entities.Server.RabbitMQ_Pass
     };
     connection = factory.CreateConnection();
     chanel     = connection.CreateModel();
 }
Exemplo n.º 3
0
        public void Dispose()
        {
            if (_model != null)
            {
                _model.Dispose();
                _model = null;
            }

            if (_connection != null)
            {
                _connection.Dispose();
                _connection = null;
            }
        }
Exemplo n.º 4
0
        public void Dispose()
        {
            if (_model != null)
            {
                _model.Dispose();
                _model = null;
            }

            if (_connection != null)
            {
                _connection.Dispose();
                _connection = null;
            }
        }
Exemplo n.º 5
0
 private void Consumer_ConnectionLost(RabbitMQ.Client.IConnection connection,
                                      RabbitMQ.Client.ShutdownEventArgs reason)
 {
     Consumer.ConnectionLost -= Consumer_ConnectionLost;
     Log.Warning("Connection lost to RabbitMQ Server due to {0}", reason.Cause);
     try
     {
         Consumer.StartConsuming();
     }
     catch (Exception ex)
     {
         Log.Warning(ex, "Shutting down old connection to allow new connection to replace it");
     }
     InitializeQueueConnection();
     StartConsuming();
 }
Exemplo n.º 6
0
 public void Connect()
 {
     _connection = _connectionFactory.CreateConnection(_configurationSettings);
     _model      = _connection.CreateModel();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleConnection"/> class.
 /// </summary>
 /// <param name="connectionDelegate">
 /// The connection delegate.
 /// </param>
 public SimpleConnection(RabbitMQ.Client.IConnection connectionDelegate)
 {
     this.connectionDelegate = connectionDelegate;
 }
Exemplo n.º 8
0
 public void Connect()
 {
     _connection = _connectionFactory.CreateConnection(_configurationSettings);
     _model = _connection.CreateModel();
 }