public void StartListen(int maximumConcurrency) { _activeMQListener = new ActiveMQListener( System.Configuration.ConfigurationManager.AppSettings["ActiveMQURL"], System.Configuration.ConfigurationManager.AppSettings["ActiveMQRQ"]); _activeMQListener.OnMessageArrived += OnMessageArrived; _activeMQListener.StartListen("", maximumConcurrency); }
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; }
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(""); } } } }
public static void StopListen() { if (_isListening) { lock (_mutex) { if (_isListening) { _msgCount = 0; _isListening = false; _activeMQListener.Close(); _activeMQListener.OnMessageArrived -= OnMessageArrived; _activeMQListener = null; } } } }
public QueueListener() { _activeMQListener = new ActiveMQListener(System.Configuration.ConfigurationManager.AppSettings["ActiveMQURL"], System.Configuration.ConfigurationManager.AppSettings["ActiveMQName"],100); }