Exemplo n.º 1
0
 public RabbitMQSubscription(RabbitMQConnection server, DALRabbitMQ dalRabbitMQ)
 {
     _DALRabbitMQ                = dalRabbitMQ;
     _Server                     = server;
     _Queues                     = new Dictionary <string, MessageQueue>();
     _UnsubscribedQueues         = new Dictionary <string, MessageQueue>();
     _SubscriptionToAdd          = new Queue <MessageQueue>();
     _ChannelHandlers            = new Dictionary <string, ChannelHandler>();
     _TriggerSubscriptionRequest = new ManualResetEvent(false);
     _InvokeCallBack             = new AsyncCallback(InvokeCallBack);
 }
Exemplo n.º 2
0
 public void Stop()
 {
     DALRabbitMQ dalRabbitMQ = _DALRabbitMQ;
     if (dalRabbitMQ != null)
     {
         _DALRabbitMQ = null;
         dalRabbitMQ.Dispose();
         dalRabbitMQ = null;
     }
 }
Exemplo n.º 3
0
 protected virtual void CheckRabbitMQ()
 {
     if (_DALRabbitMQ == null)
     {
         lock (this)
         {
             if (_DALRabbitMQ == null)
             {
                 _DALRabbitMQ = new DALRabbitMQ(ServiceConfiguration.RabbitMQConnections);
                 if (_Subscriptions.Count > 0)
                 {
                     lock (_Subscriptions)
                     {
                         foreach (Subscription item in _Subscriptions)
                         {
                             _DALRabbitMQ.Subscribe(item.QueueName, item.Durable, item.Temporary, item.RoutingKey, item.Handler);
                         }
                     }
                 }
             }
         }
     }
 }
        public RabbitMQSubscription(RabbitMQConnection server, DALRabbitMQ dalRabbitMQ)
		{
            _DALRabbitMQ = dalRabbitMQ;
            _Server = server;
			_Queues = new Dictionary<string, MessageQueue>();
			_UnsubscribedQueues = new Dictionary<string, MessageQueue>();
			_SubscriptionToAdd = new Queue<MessageQueue>();
			_ChannelHandlers = new Dictionary<string, ChannelHandler>();
			_TriggerSubscriptionRequest = new ManualResetEvent(false);
			_InvokeCallBack = new AsyncCallback(InvokeCallBack);
		}