예제 #1
0
        private void bReceive_Click(object sender, EventArgs e)
        {
            if (_mq == null)
            {
                _mq = new RabbitMQService(_depoy);
            }
            _mq.Connect();
            _mq.StartConsume(_depoy);
            _mq.Received +=
                (object sR, RabbitMQ.Client.Events.BasicDeliverEventArgs eR) =>
            {
                string rStr = StringCodeChange.DeserializeObject <string>(eR.Body);
                this.Invoke(new SetValue((o) => { textBox1.Text += o + "\r\n"; }), rStr);

                //textBox1.Text += rStr + "\r\n";
                _mq.StopConsume();
            };
        }
예제 #2
0
 private void bSend_Click(object sender, EventArgs e)
 {
     byte[] s10 = StringCodeChange.SerializeObject(GetString(10));
     _mq.Publish(s10);
     _mq.Disconnect();
 }