Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     KafkaWorker.brokerList       = txt_url.Text.Trim();
     KafkaWorker.messageTopicName = txt_topic.Text.Trim();
     if (KafkaWorker.init())
     {
         tabControl1.Enabled = true;
     }
 }
Exemplo n.º 2
0
 private void Timer_Tick(object sender, EventArgs e)
 {
     if (messageQueue.Count > 0)
     {
         string message = messageQueue.Dequeue();
         KafkaWorker.sendAlarmMessage(message, ckb_showMessage.Checked);
     }
     else
     {
         timer.Stop();
         MessageBox.Show("已经没有待发的消息了");
         btn_start.Enabled = true;
         btn_stop.Enabled  = false;
     }
 }
Exemplo n.º 3
0
 private void btn_send_Click(object sender, EventArgs e)
 {
     KafkaWorker.sendAlarmMessage(rtb_message.Text.Trim(), false, true);
 }