public void OnMessageReceived(object sender, MessageReceivedEventArgs e) {
            var paramaters = e.Message.Split(',');

            var number = Convert.ToInt32(paramaters[0]);
            var result = Functions.Double(number);

            var queueName = paramaters[1];
            _adapter.Publish(result.ToString(), queueName);
        }
        private void _autoScaleConsumerCatchAll_MessageReceived(object sender, MessageReceivedEventArgs e) {

            if (e.Message.Contains("scale-out")) {
                var consumer = new RabbitMQConsumerCatchAll("Math", 10);
                _adapter.ConsumeAsync(consumer);
                _consumers.Add(consumer);
            }
            else {
                if (_consumers.Count <= 1) return;
                var lastConsumer = _consumers[_consumers.Count - 1];

                _adapter.StopConsumingAsync(lastConsumer);
                _consumers.RemoveAt(_consumers.Count - 1);
            }
        }
 public void OnMessageReceived(object sender, MessageReceivedEventArgs e) {
     throw new NotImplementedException();
 }
 public void OnMessageReceived(object sender, MessageReceivedEventArgs e) {
     var result = Functions.Reverse(e.Message);
     Console.WriteLine(result);
 }
예제 #5
0
 protected void OnMessageReceived(MessageReceivedEventArgs e) {
     var handler = MessageReceived;
     if (handler != null) handler(this, e);
 }