예제 #1
0
        public void StartListen(int maximumConcurrency)
        {
            _activeMQListener = new ActiveMQListener(
                        System.Configuration.ConfigurationManager.AppSettings["ActiveMQURL"],
                        System.Configuration.ConfigurationManager.AppSettings["ActiveMQRQ"]);

            _activeMQListener.OnMessageArrived += OnMessageArrived;
            _activeMQListener.StartListen("", maximumConcurrency);
        }
예제 #2
0
        private async void btnListen_Click(object sender, EventArgs e)
        {
            _activeMQListener = new ActiveMQListener(System.Configuration.ConfigurationManager.AppSettings["ActiveMQURL"], System.Configuration.ConfigurationManager.AppSettings["ActiveMQName"]);

            _activeMQListener.OnMessageArrived += OnMessageArrived;
            _activeMQListener.StartListen("", 10);

            //timer = new System.Timers.Timer(1000);
            //timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
            //timer.Enabled = true;
        }
예제 #3
0
 public static void StartListen()
 {
     if (!_isListening)
     {
         lock (_mutex)
         {
             if (!_isListening)
             {
                 _isListening = true;
                 _activeMQListener = new ActiveMQListener(System.Configuration.ConfigurationManager.AppSettings["ActiveMQURL"], System.Configuration.ConfigurationManager.AppSettings["ActiveMQName"],100);
                 _activeMQListener.OnMessageArrived += OnMessageArrived;
                 _activeMQListener.StartListen("");
             }
         }
     }
 }
예제 #4
0
 public static void StopListen()
 {
     if (_isListening)
     {
         lock (_mutex)
         {
             if (_isListening)
             {
                 _msgCount = 0;
                 _isListening = false;
                 _activeMQListener.Close();
                 _activeMQListener.OnMessageArrived -= OnMessageArrived;
                 _activeMQListener = null;
             }
         }
     }
 }
예제 #5
0
 public QueueListener()
 {
     _activeMQListener = new ActiveMQListener(System.Configuration.ConfigurationManager.AppSettings["ActiveMQURL"], System.Configuration.ConfigurationManager.AppSettings["ActiveMQName"],100);
 }