private void uiqp1Start_Click(object sender, EventArgs e) { var ep = new IPEndPoint(Dns.GetHostAddresses(uiqp1Address.Text)[0], Convert.ToInt32(uiqp1Port.Text)); var dispatcher = new TcpInterQueueClient_V1_1(ep, uiqp1DstQueue.Text); batchConsumer = new QueueBatchConsumer(txtQueueName.Text, dispatcher, ""); batchConsumer.Start(); uiqp1Start.Enabled = false; }
private void button1_Click(object sender, EventArgs e) { var dispatcher = new QueueSimpleDispatcher { Destination = textBox2.Text }; batchConsumer = new QueueBatchConsumer(textBox1.Text, dispatcher, ""); batchConsumer.Start(); button1.Enabled = false; timer1.Enabled = true; }
private void button1_Click(object sender, EventArgs e) { var queue_clone = new QueueCloneDispatcher { QueueOne = textBox2.Text, QueueTwo = textBox3.Text }; batchConsumer = new QueueBatchConsumer(textBox1.Text, queue_clone, ""); batchConsumer.Start(); timer1.Enabled = true; textBox1.Enabled = false; textBox2.Enabled = false; textBox3.Enabled = false; button1.Enabled = false; button2.Enabled = false; }
private void uiqp2Start_Click(object sender, EventArgs e) { if (uiqp2Start.Text == "Detener") { uiqp2BatchConsumer.Stop(); uiqp2BatchConsumer = null; uiqp2Start.Text = "Iniciar"; } else { var ep = new IPEndPoint(Dns.GetHostAddresses(uiqp2Address.Text)[0], Convert.ToInt32(uiqp2Port.Text)); var dispatcher = new TcpInterQueueClient_V1_2(ep, uiqp2DstQueue.Text); uiqp2BatchConsumer = new QueueBatchConsumer(txtQueueName.Text, dispatcher, ""); uiqp2BatchConsumer.Start(); uiqp2Start.Text = "Detener"; } }
private void timer1_Tick(object sender, EventArgs e) { var path = @".\private$\" + textBox1.Text; var msgs = MessageQueueMonitor.GetMessagesInQueue(path); if (msgs < 1) { batchConsumer = null; timer1.Enabled = false; textBox1.Enabled = true; textBox2.Enabled = true; textBox3.Enabled = true; button2.Enabled = true; textBox1.Text = textBox1.Text; RefreshScreen(false); return; } RefreshScreen(false); }
public static void Start() { var queues_directive = Config.GetConfigurationString("interqueue", "queues", ""); server = new TcpInterQueueServer(new IPEndPoint(IPAddress.Any, Config.GetConfigurationInt("interqueue", "listen_port", 7532)), 0, false); if (String.IsNullOrEmpty(queues_directive)) { return; } var queues = queues_directive.Split(",".ToCharArray()); foreach (var queue in queues) { // validamos si la cola esta deshabilitada. if (Config.GetConfigurationBool(queue, "disabled", false)) { continue; } // creo e inicializo el nodo local, quien consume la cola. var local_queue = Config.GetConfigurationString(queue, "local_queue", ""); if (String.IsNullOrEmpty(local_queue)) { T.ERROR("Queue: {0} falta setear el nombre local.", queue); continue; } var label_reformat_expression = Config.GetConfigurationString(queue, "label_reformat_expression", ""); var remote_queue = Config.GetConfigurationString(queue, "remote_queue", local_queue); var remote_host = Config.GetConfigurationIPAddress(queue, "remote_host", IPAddress.None); if (remote_host == IPAddress.None) { T.ERROR("Queue: {0} falta setear el host remoto.", queue); continue; } var remote_port = Config.GetConfigurationInt(queue, "remote_port", 7532); var remote_ep = new IPEndPoint(remote_host, remote_port); var tcpcli = new TcpInterQueueClient_V1_1(remote_ep, remote_queue); var dispatcher = new QueueBatchConsumer(local_queue, tcpcli, label_reformat_expression); dispatchers.Add(queue, dispatcher); dispatcher.Start(); } }