Пример #1
0
        private void sendButton_Click(object sender, EventArgs e)
        {
            var headers       = new Dictionary <string, string>();
            var messageSender = new RabbitSender();

            headers.Add("material", GetComboItem(materialsComboBox));
            headers.Add("customertype", GetComboItem(customerTypeComboBox));

            var message = string.Format("Message: {0}", messageCount);

            messageSender.Send(message, headers);

            MessageBox.Show(string.Format("Sending Message - {0}", message), "Message sent");

            messageCount++;
        }
Пример #2
0
        private void sendButton_Click(object sender, EventArgs e)
        {
            var topics        = new List <string>();
            var messageSender = new RabbitSender();

            topics.Add(GetComboItem(customerTypeComboBox));
            topics.Add(GetComboItem(orderSizeComboBox));
            topics.Add(GetComboItem(productComboBox));

            var message = string.Format("Message: {0}", messageCount);

            var routingkey = messageSender.Send(message, topics);

            MessageBox.Show(string.Format("Sending Message - {0}, Routing Key - {1}", message, routingkey), "Message sent");

            messageCount++;
        }